long
:: String -> Mod
Set the long name of an option. |
short
:: String -> Mod
Set the short name of an option. |
optional
:: Mod
Set the optional flag of an argument. |
metavar
:: String -> Mod
Set the metavar of an argument. |
help
:: String -> Mod
Set the help text of an argument. |
(<>)
:: Mod -> Mod -> Mod
Combine two modifiers. |
option
:: (String -> a) -> Mod -> [Parser a]
Create an option. |
arg
:: (String -> a) -> Mod -> [Parser a]
Create a positional argument. |
rest
:: (String -> a) -> Mod -> [Parser a]
Create an argument that consumes the rest of the command line. |
flag
:: a -> Mod -> [Parser a]
Create a flag. |
(<.>)
:: [a] -> [a] -> [a]
Combine two arguments. |
(<|>)
:: [a] -> [a] -> [a]
Combine command sub parsers. |
command
:: String -> Mod -> a -> [Parser a] -> [(String,ArgProps,a,ParseSpec a)]
Create a sub-parser for a command. |
optParser
:: [Parser a] -> ParseSpec a
Create a parse spec from a list of parsers. |
commands
:: Mod -> [(String,ArgProps,a,ParseSpec a)] -> [Parser a]
Create a command parser. |
printUsage
:: String -> Int -> ParseSpec a -> IO ()
Print usage information for a command line parser specification. |
renderUsage
:: String -> Int -> ParseSpec a -> String
Render usage information to a string. |
parse
:: String -> ParseSpec a -> String -> Either String [a]
Parses a command line via a parser spec. |
A command line argument. Used to represent a parsed command line.
Constructors:
A partial command line parser.
Constructors:
A parser specification. A collection of parsers.
Constructors:
Properties that for all parser types.
Constructors:
Properties for option/flag parsers.
Constructors:
Modifiers for argument and option properties.
Constructors:
Set the long name of an option.
|
Set the short name of an option.
|
Set the optional flag of an argument.
|
Set the metavar of an argument. The metavar is used to print usage information.
|
Set the help text of an argument. Used to print usage information.
|
Create an option.
|
Create a positional argument.
|
Create an argument that consumes the rest of the command line.
|
Create a flag.
|
Combine two arguments.
|
Combine command sub parsers.
|
Create a sub-parser for a command. Must be used with
|
Create a parse spec from a list of parsers.
|
Create a command parser.
|
Print usage information for a command line parser specification.
|
Render usage information to a string.
|