optparse-simple

Simple interface to optparse-applicative

Version on this page:0.0.4
LTS Haskell 17.12:0.1.1.3
Stackage Nightly 2021-05-16:0.1.1.3
Latest on Hackage:0.1.1.3

See all snapshots optparse-simple appears in

BSD-3-Clause licensed by FP Complete
This version can be pinned in stack with:optparse-simple-0.0.4@sha256:1dcd36101bdb5131286f17e52926bed21b6543a52a3883bdf6b76cfc7d560ad0,1212

Module documentation for 0.0.4

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