@hackage simple-cmd-args0.1.0

Simple command args parsing and execution

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](examples/).