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

[ bsd3, library, system ] [ Propose Tags ]

This is a small wrapper over optparse-applicative which allows combining args parsers directly with IO commands. For subcommands this can avoid type boilerplate. It also provides some compact aliases for options with their Mod's.


[Skip to Readme]
Versions [faq] 0.1.0, 0.1.0.1, 0.1.1, 0.1.2
Change log CHANGELOG.md
Dependencies base (==4.*), optparse-applicative (>=0.14.1), semigroups [details]
License BSD-3-Clause
Copyright 2019 Jens Petersen
Author Jens Petersen
Maintainer juhpetersen@gmail.com
Category System
Home page https://github.com/juhp/simple-cmd-args
Bug tracker https://github.com/juhp/simple-cmd-args/issues
Source repo head: git clone https://github.com/juhp/simple-cmd-args.git
Uploaded by JensPetersen at Fri May 24 06:12:07 UTC 2019
Distributions LTSHaskell:0.1.2, NixOS:0.1.2, Stackage:0.1.2
Downloads 419 total (74 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-05-24 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for simple-cmd-args-0.1.2

[back to package description]

simple-cmd-args

Hackage BSD license Stackage Lts Stackage Nightly Build status

A thin layer over optparse-applicative that avoids type plumbing for subcommands by using Parser (IO ()).

Usage

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

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

See more examples.