foliage/app/Options.hs

34 lines
641 B
Haskell
Raw Normal View History

2022-03-09 16:29:23 +03:00
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"
)