{-# LANGUAGE DeriveDataTypeable #-}
module Config where
import System.Console.CmdArgs
data Config = Get { repos :: [String] }
| Run { fast :: Bool
, only :: [String]
, dump :: Bool
, extra :: [String] }
deriving (Show, Data, Typeable)
defaultConfig :: [Mode Config]
defaultConfig =
[ mode $ Get { repos = [] &= args & typ "REPONAME" }
, mode $ Run { fast = False &= text "Exclude the most time-consuming benchmarks"
, dump = False &= text "Produce machine-readable output on stdout"
, only = [] &= text "Only run benchmarks with one of these substrings in their names" & typ "BENCHMARK"
, extra = [] &= args & typ "BINARY"
}
]