flags-applicative: Applicative flag parsing

[ bsd3, library, web ] [ Propose Tags ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 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, 0.1.0.2, 0.1.0.3
Dependencies base (>=4.7 && <5), containers (>=0.6 && <0.7), flags-applicative, mtl (>=2.2 && <2.3), text (>=1.2 && <1.3) [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 2019-05-26T06:53:21Z
Distributions LTSHaskell:0.1.0.3, NixOS:0.1.0.3, Stackage:0.1.0.3
Executables simple-example
Downloads 6154 total (45 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-05-26 [all 1 reports]

Readme for flags-applicative-0.0.2.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.