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

[ bsd3, library, system ] [ Propose Tags ]

This 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]

Modules

[Last Documentation]

  • SimpleCmdArgs

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0, 0.1.0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8
Change log CHANGELOG.md
Dependencies base (>=4 && <5), optparse-applicative, 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 2019-02-20T04:41:14Z
Distributions Fedora:0.1.8, LTSHaskell:0.1.8, NixOS:0.1.8, Stackage:0.1.8
Downloads 4904 total (44 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2019-02-20 [all 2 reports]

Readme for simple-cmd-args-0.1.0

[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 the common use case of a commandline tool with 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" (putStrLn <$> strArg "NAME") "Print name"
    , Subcommand "ls" (cmd_ "ls" <$> some (strArg "FILE...")) "Touch FILE"
    ]

See more https://github.com/juhp/simple-cmd-args/tree/master/examples.