flags-applicative: Applicative flag parsing

[ bsd3, library, web ] [ Propose Tags ]

https://github.com/mtth/flags-applicative


[Skip to Readme]
Versions [faq] 0.0.1.0, 0.0.2.0, 0.0.3.0, 0.0.4.0, 0.0.4.1, 0.0.4.2, 0.0.4.3, 0.0.4.4, 0.0.4.5, 0.0.5.0, 0.0.5.2, 0.1.0.0, 0.1.0.1
Dependencies base (>=4.7 && <5), containers (==0.6.*), flags-applicative, mtl (==2.2.*), text (==1.2.*) [details]
License BSD-3-Clause
Copyright 2019 Matthieu Monsch
Author Matthieu Monsch
Maintainer matthieu.monsch@gmail.com
Category Web
Home page https://github.com/mtth/flags-applicative
Source repo head: git clone https://github.com/mtth/flags-applicative
Uploaded by mtth at Sun May 26 16:13:18 UTC 2019
Distributions NixOS:0.1.0.1
Executables simple-example
Downloads 1313 total (367 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-05-26 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for flags-applicative-0.0.3.0

[back to package description]

Applicative flags

Simple flags parsing, inspired by optparse-applicative:

data Options = Options
  { rootPath :: Text
  , logLevel :: Int
  , context :: Maybe Text
  } deriving Show

optionsParser :: FlagParser Options
optionsParser = Options <$> textFlag "root" "path to the root"
                        <*> (numericFlag decimal "log_level" "" <|> pure 0)
                        <*> (optional $ textFlag "context" "")

See the documentation for more information.