definition:
|
options :: [OptDescr (TransState -> TransState)]
options =
[ Option "h?" ["help"]
(NoArg (\opts -> opts { optHelp = True }))
"print help and exit"
, Option "q" ["quiet"]
(NoArg (\opts -> opts { optVerb = 0 }))
"run quietly (no output, only exit code)"
, Option "v" ["verbosity"]
(OptArg (maybe (checkVerb 2) (safeReadNat checkVerb)) "<n>")
"verbosity level:\n0: quiet (same as `-q')\n1: show status messages (default)\n2: show generated program (same as `-v')\n3: show all details"
, Option "o" ["output"]
(ReqArg (\s opts -> opts { optOutput = s }) "<f>")
("output file for Curry program (or '-')\n(otherwise: store in PROG.curry)")
, Option "r" ["run"]
(NoArg (\opts -> opts { optLoad = True }))
"load the Curry program after generating it"
, Option "w" ["nowarn"]
(NoArg (\opts -> opts { optNoWarn = True }))
"turn off all warnings for generated Curry program"
, Option "c" ["conservative"]
(NoArg (\opts -> opts { withFunctions = False }))
"conservative transformation into predicates"
, Option "" ["nodemand"]
(NoArg (\opts -> opts { withDemand = False }))
"do not exploit demand evaluation via let bindings"
, Option "" ["noinline"]
(NoArg (\opts -> opts { withInline = False }))
"do not inline where/let bindings in Curry code"
, Option "" ["noanalysis"]
(NoArg (\opts -> opts { useAnalysis = False }))
"do not derive function information automatically"
, Option "" ["anyresult"]
(NoArg (\opts -> opts { optAnyResult = True }))
"allow any position as result (not only the last)"
, Option "" ["nolists"]
(NoArg (\opts -> opts { useLists = False }))
"do not use Curry lists but untyped raw lists"
, Option "" ["failfuncs"]
(ReqArg (\s opts -> opts { optFailFuncs = s }) "<f>")
"use fail-sensitive functional transformation\nand read failing functions from file"
]
where
safeReadNat opttrans s opts = case readNat s of
[(n,"")] -> opttrans n opts
_ -> error "Illegal number argument (try `-h' for help)"
checkVerb n opts = if n>=0 && n<4
then opts { optVerb = n }
else error "Illegal verbosity level (try `-h' for help)"
|