Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 4520fee17a
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (39 sloc) 1.427 kB
module Options where
import System.Console.GetOpt
data Options = Options {
optCacheAsts :: Bool,
optNumCores :: Int,
optFiles :: Bool,
optDir :: Maybe String,
optStartAtFile :: Maybe String}
deriving Show
defaultOptions :: Options
defaultOptions = Options {
optCacheAsts = True,
optNumCores = 1,
optFiles = False,
optDir = Nothing,
optStartAtFile = Nothing}
options :: [OptDescr (Options -> Options)]
options = [
Option "a" ["do-not-cache-asts"]
(NoArg (\ opts -> opts {optCacheAsts = False}))
"Do not cache binary dump of ASTs to disk (in .ast/).",
Option "C" ["num-cores"]
(ReqArg (\ n opts -> opts {optNumCores = read n}) "<n>")
"Run n OS threads to optimize for n cores.",
Option "d" ["dir"]
(ReqArg (\ d opts -> opts {optDir = Just d}) "<dir>")
"Top-level directory containing parsable\n\
\files of interest. Abstract syntax trees\n\
\will be cached in top-level .ast/\n\
Option "f" ["files"]
(NoArg (\ opts -> opts {optFiles = True}))
"Pass a specific list of files to stdin\n\
Option "s" ["start-at-file"]
(ReqArg (\ f opts -> opts {optStartAtFile = Just f}) "<file>")
"Start at a particular file instead of the\n\
\\"beginning\" of the file list, looping back\n\
\around to get all files."]
Jump to Line
Something went wrong with that request. Please try again.