Popularity
8.6
Stable
Activity
0.0
Declining
43
12
3
Monthly Downloads: 61
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Latest version: v0.13
getopt-generics alternatives and similar packages
Based on the "Console" category.
Alternatively, view getopt-generics alternatives based on common mentions on social networks and blogs.
-
hunt-server-cli
A Command line Interface for the Hunt server. -
spelling-suggest
Spelling suggestion tool with library and command-line interfaces. -
hledger-stockquotes
Generate HLedger Price Directives From Daily Stock Quotes. -
structured-cli
Application library for building interactive console CLIs -
hledger-makeitso
An hledger workflow focusing on automated statement import and classification. -
cmdtheline
Declarative command-line option parsing and documentation library.
Get performance insights in less than 4 minutes
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of getopt-generics or a related project?
README
getopt-generics
Status
This library is experimental.
Usage
getopt-generics
tries to make it very simple to create command line
interfaces. Here's an example:
<!--- ### Start "docs/Simple.hs" "module Simple where\n\n" (MarkDown Haskell) ### -->
import WithCli
main :: IO ()
main = withCli run
run :: String -> Int -> Bool -> IO ()
run s i b = print (s, i, b)
<!--- ### End ### -->
This is how the program behaves in a shell:
<!--- ### Start "docs/Simple.shell-protocol" "" (MarkDown Shell) ### -->
$ program foo 42 true
("foo",42,True)
$ program --help
program [OPTIONS] STRING INTEGER BOOL
-h --help show help and exit
$ program foo 42 bar
cannot parse as BOOL: bar
# exit-code 1
$ program
missing argument of type STRING
missing argument of type INTEGER
missing argument of type BOOL
# exit-code 1
$ program foo 42 yes bar
unknown argument: bar
# exit-code 1
<!--- ### End ### -->