mirror of
https://github.com/input-output-hk/foliage.git
synced 2024-12-02 07:54:45 +03:00
34 lines
641 B
Haskell
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"
|
|
)
|