A reader that can parse a string value into a typed result. $$\text{ReadM}\ \alpha := \text{String} \to \text{Except String}\ \alpha$$
Equations
- Options.Applicative.ReadM α = (String → Except String α)
Instances For
Equations
- Options.Applicative.instInhabitedReadM = { default := fun (x : String) => Except.error "no reader" }
Option visibility and characteristics. Combines long/short names, help text, metavar, and visibility.
Long option name (e.g., "output" for --output).
Short option character (e.g., 'o' for -o).
Help text displayed in usage.
Metavar displayed in usage (e.g., FILE in --output FILE).
- showDefault : Bool
Whether to show the default value in help text.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Combine two Mod values, with the right-hand side taking precedence
for fields that are set.
Equations
- One or more equations did not get rendered due to their size.
Modifier configuration for ParserInfo.
$$\text{InfoMod} := \text{ParserInfo-level modifiers}$$
Program description.
Header text shown before usage.
- fullDesc : Bool
Whether to show full description in help.
- failureCode : Nat
Exit code on parse failure.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Description of a single option, used for generating help text. Separated from the parsing logic so that the parser can be a plain function type.
- optionDescr
(mods : Mod)
: OptDescr
A named option (--long / -s).
- flagDescr
(mods : Mod)
: OptDescr
A flag (--long / -s, no value).
- argDescr
(mods : Mod)
: OptDescr
A positional argument.
- cmdDescr
(commands : List (String × Option String))
: OptDescr
A subcommand group.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
A composable command-line parser. Internally a function from an argument list to either an error or a pair of (parsed value, remaining args). Option descriptions are tracked separately for help generation.
$$\text{Parser}\ \alpha := \{ \text{run} : \text{List String} \to \text{Except String}\ (\alpha \times \text{List String}), \text{descrs} : \text{List OptDescr} \}$$
Run the parser on an argument list, returning the result and remaining args.
Option descriptions for help text generation.
Instances For
Parser with metadata for help text generation. $$\text{ParserInfo}\ \alpha := (\text{Parser}\ \alpha, \text{description}, \text{header}, \text{footer}, \ldots)$$
- parser : Parser α
The underlying parser.
Program description.
Header text shown before usage.
- fullDesc : Bool
Whether to show full description.
- failureCode : Nat
Exit code on parse failure.