simple-cmd-args

Simple command args parsing and execution https://github.com/juhp/simple-cmd-args

Version on this page:0.1.2
LTS Haskell 14.11:0.1.3
Stackage Nightly 2019-10-21:0.1.3
Latest on Hackage:0.1.3

See all snapshots simple-cmd-args appears in

BSD-3-Clause licensed by Jens Petersen
Maintained by juhpetersen@gmail.com

Module documentation for 0.1.2

This version can be pinned in stack with:simple-cmd-args-0.1.2@sha256:c6590a1a6db0d03751831ae4dbd276c5f7cb85028594e7b91aa063f83b33d09a,1408

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.

Changes

Changelog

simple-cmd-args uses PVP Versioning.

0.1.2

  • add flagWith and flagWith’
  • export Parser, auto, optional

0.1.1

  • add switchWith, strOptionWith, optionWith, optionalWith, strOptionalWith, argumentWith
  • export simpleCmdArgsWithMods

0.1.0.1

  • fix and improve haddock documentation

0.1.0

  • Initial release with subcommands and option Mod functions
Used by 2 packages in nightly-2019-08-29(full list with versions):
comments powered byDisqus