optparse-simple

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

Version on this page:0.0.2
LTS Haskell 9.17:0.0.4
Stackage Nightly 2017-12-10:0.1.0
Latest on Hackage:0.1.0
BSD3 licensed by FP Complete
Maintained by chrisdone@fpcomplete.com

Module documentation for 0.0.2

There are no documented modules for this package.

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

0.1.0

  • Migrate from EitherT to ExceptT #8

0.0.4

  • Support --help on subcommands
comments powered byDisqus