optparse-simple

Simple interface to optparse-applicative

Version on this page:0.0.4
LTS Haskell 15.13:0.1.1.2
Stackage Nightly 2020-05-23: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 [email protected]

Module documentation for 0.0.4

This version can be pinned in stack with:[email protected]:1dcd36101bdb5131286f17e52926bed21b6543a52a3883bdf6b76cfc7d560ad0,1212

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.0.4

  • Support --help on subcommands