optparse-simple: Simple interface to optparse-applicative

[ bsd3, library, options ] [ Propose Tags ]

Simple interface to optparse-applicative


[Skip to Readme]

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.1.1, 0.1.1.1, 0.1.1.2, 0.1.1.3, 0.1.1.4
Change log ChangeLog.md
Dependencies base (>=4 && <5), either (<5), gitrev, optparse-applicative, template-haskell, transformers [details]
License BSD-3-Clause
Copyright 2015 FP Complete
Author FP Complete
Maintainer chrisdone@fpcomplete.com
Revised Revision 1 made by HerbertValerioRiedel at 2019-01-03T20:10:19Z
Category Options
Source repo head: git clone https://github.com/fpco/optparse-simple
Uploaded by MichaelSnoyman at 2017-10-31T17:54:32Z
Distributions Arch:0.1.1.4, Debian:0.1.1.2, Fedora:0.1.1.4, LTSHaskell:0.1.1.4, NixOS:0.1.1.4, Stackage:0.1.1.4
Reverse Dependencies 10 direct, 29 indirect [details]
Downloads 28170 total (134 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-31 [all 1 reports]

Readme for optparse-simple-0.0.4

[back to package description]

optparse-simple

Simple interface to optparse-applicative

Usage

Typical usage with no commands:

do (opts,()) <-
     simpleOptions "ver"
                   "header"
                   "desc"
                   (flag () () (long "some-flag"))
                   empty
   doThings opts

Typical usage with commands:

do (opts,runCmd) <-
     simpleOptions "ver"
                   "header"
                   "desc"
                   (pure ()) $
     do addCommand "delete"
                   "Delete the thing"
                   (const deleteTheThing)
                   (pure ())
        addCommand "create"
                   "Create a thing"
                   createAThing
                   (strOption (long "hello"))
   runCmd