argparser alternatives and similar packages
Based on the "Console" category.
Alternatively, view argparser alternatives based on common mentions on social networks and blogs.
-
hledger-flow
An hledger/ledger-cli workflow focusing on automated statement import and classification -
hledger-stockquotes
Generate an HLedger Journal Containing Daily Stock & Crypto Quotes for your Commodities -
uniq-deep
alternative of unix uniq command. 'uniq-deep' detect repeated lines unless they are adjacent. -
pasty
pasty is a linux command line tool written in Haskell for pasting from column centric plain text files.
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of argparser or a related project?
README
ArgParser
Declarative & minimalist command line app framework for haskell
This framework is inspired by the argparse package found in python batteries.
This library provides a small combinator dsl to specify a parser for a datatype. Running the parser will automatically consume and convert command line arguments. Default special action such as help/usage are automatically built from the parser specification.
Here is a quick example. First, we need a datatype:
data MyTest = MyTest Int Int
deriving (Show) -- we will print the values
Then, we define a parser:
myTestParser :: ParserSpec MyTest
myTestParser = MyTest
`parsedBy` reqPos "pos1"
`andBy` optPos 0 "pos2"
we can now run a MyTest -> IO ()
value. It will either perform the
action with the parse result, or display an error message:
main = withParseResult myTestParser print
Building this app will produce an executable foo
which will behave like this:
$ foo 1 2
MyTest 1 2
$ foo 3
MyTest 3 0
$ foo -h
foo
usage : foo pos1 [pos2] [-h] [--version]
mandatory arguments:
pos1
optional arguments:
pos2
-h, --help show this help message and exit
--version print the program version and exit
For more information, please visit http://hackage.haskell.org/package/argparser-0.3.2/docs/System-Console-ArgParser.html .