foliage/app/Options.hs
2022-03-09 21:29:23 +08:00

34 lines
641 B
Haskell

module Options
( parseOptions,
Options (..),
module Options.Applicative,
)
where
import Options.Applicative
parseOptions :: IO Options
parseOptions =
execParser $
info
(optionsParser <**> helper)
( fullDesc
<> progDesc "foliage"
<> header "foliage - a builder for static Hackage repositories"
)
newtype Options = Options
{ optionsConfig :: FilePath
}
optionsParser :: Parser Options
optionsParser =
Options
<$> strOption
( long "config"
<> metavar "CONFIG"
<> help "Config file"
<> showDefault
<> value "config.toml"
)