simple-cmd-args: Simple command args parsing and execution

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

This is a small wrapper over optparse-applicative which allows combining args parsers directly with IO commands, avoiding command types boilerplate. It also provides a few option Mod functions.

[Skip to Readme]


Versions 0.1.0,,, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7
Change log
Dependencies base (==4.*), optparse-applicative, semigroups [details]
License BSD-3-Clause
Copyright 2019 Jens Petersen
Author Jens Petersen
Category System
Home page
Bug tracker
Source repo head: git clone
Uploaded by JensPetersen at 2019-02-22T08:03:10Z




Maintainer's Corner

For package maintainers and hackage trustees

Readme for simple-cmd-args-

[back to package description]


Hackage BSD license Stackage Lts Stackage Nightly Build status

A thin layer over optparse-applicative that avoids type plumbing for the common use case of a commandline tool with subcommands, by using Parser (IO ()).


import SimpleCmdArgs
import Control.Applicative (some)
import SimpleCmd (cmd_)

main =
  simpleCmdArgs Nothing "my example tool" "Longer description..." $
    [ Subcommand "echo" (putStrLn <$> strArg "NAME") "Print name"
    , Subcommand "ls" (cmd_ "ls" <$> some (strArg "FILE...")) "Touch FILE"

See more examples.