BSD-3-Clause licensed by FP Complete
Maintained by [email protected]
This version can be pinned in stack with:optparse-simple-0.1.1.1@sha256:e6d007b840fc563a28c976b516f29043a2c49484ad78534213d56930a6119d2c,1912

Module documentation for 0.1.1.1

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