Added a command-line option to print out the module directory
This commit is contained in:
parent
cfcf50297f
commit
d595b73f28
5
Main.hs
5
Main.hs
|
@ -49,6 +49,7 @@ import ParseOccam
|
|||
import ParseRain
|
||||
import Pass
|
||||
import PassList
|
||||
import Paths
|
||||
import PreprocessOccam
|
||||
import PrettyShow
|
||||
import ShowCode
|
||||
|
@ -73,6 +74,7 @@ optionsNoWarnings =
|
|||
, Option [] ["run-indent"] (NoArg $ optRunIndent) "run indent on source before compilation (will full mode)"
|
||||
, Option [] ["frontend"] (ReqArg optFrontend "FRONTEND") "language frontend (options: occam, rain)"
|
||||
, Option [] ["mode"] (ReqArg optMode "MODE") "select mode (options: flowgraph, lex, html, parse, compile, post-c, full)"
|
||||
, Option [] ["module-path"] (NoArg $ optPrintPath tockModuleDir) "print module path"
|
||||
, Option ['c'] ["no-main"] (NoArg optNoMain) "file has no main process; do not link either"
|
||||
, Option ['o'] ["output"] (ReqArg optOutput "FILE") "output file (default \"-\")"
|
||||
, Option [] ["sanity-check"] (ReqArg optSanityCheck "SETTING") "internal sanity check (options: on, off)"
|
||||
|
@ -156,6 +158,9 @@ optStackSize s ps = return $ ps { csUnknownStackSize = read s }
|
|||
optOutput :: String -> OptFunc
|
||||
optOutput s ps = return $ ps { csOutputFile = s }
|
||||
|
||||
optPrintPath :: String -> OptFunc
|
||||
optPrintPath path _ = printString path
|
||||
|
||||
optPrintHelp :: OptFunc
|
||||
optPrintHelp _ = printString $ usageInfo "Usage: tock [OPTION...] SOURCEFILE" optionsNoWarnings
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user