optparse-simple

Simple interface to optparse-applicative https://github.com/fpco/optparse-simple#readme

Version on this page:0.1.1.2
LTS Haskell 13.22:0.1.1.2
Stackage Nightly 2019-05-22:0.1.1.2
Latest on Hackage:0.1.1.2

See all snapshots optparse-simple appears in

BSD-3-Clause licensed by FP Complete
Maintained by chrisdone@fpcomplete.com

Module documentation for 0.1.1.2

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

Changes

ChangeLog for optparse-simple

0.1.1.2

  • Run TH slice at the right time to get proper Git info #13

0.1.1.1

  • Add explicit signature to work around #12

0.1.1

  • Switch dependency gitrev to githash

0.1.0

  • Migrate from EitherT to ExceptT #8

0.0.4

  • Support --help on subcommands
comments powered byDisqus