|
definition: |
processOptions :: PPOpts -> [String] -> Maybe PPOpts
processOptions opts optargs = case optargs of
[] -> Just opts
("--help":_) -> Just opts { optHelp = True}
("-h":_) -> Just opts { optHelp = True}
("-?":_) -> Just opts { optHelp = True}
("-o":os) -> processOptions opts { optSave = True } os
("-v":os) -> processOptions opts { optVerb = 2 } os
(['-','v',vl]:os) -> if isDigit vl
then processOptions opts { optVerb = digitToInt vl } os
else Nothing
(('-':'-':ts):os) -> if isPrefixOf "model:" ts
then processOptions
opts {optModel = tail (dropWhile (/=':') ts) }
os
else Nothing
(o:os) -> if o `elem` ["-e","-t"]
then processOptions
opts {optContracts = optContracts opts ++ [o]} os
else
if o `elem` ["nodupscheme","specscheme"]
then processOptions
opts {optDefRules = optDefRules opts ++ [o]} os
else
maybe Nothing
(\t -> processOptions
opts {optTgts = t : optTgts opts} os)
(parseTarget o)
|
|
demand: |
argument 2 |
|
deterministic: |
deterministic operation |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,{[]}) |-> {Just} || (_,{:}) |-> _}
|
|
name: |
processOptions |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
PPOpts -> [String] -> Prelude.Maybe PPOpts |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |