foliage/app/Foliage/Options.hs

34 lines
649 B
Haskell
Raw Normal View History

2022-03-11 11:10:49 +03:00
module Foliage.Options
2022-03-09 16:29:23 +03:00
( 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"
)