Specifies a single command line flag
For example: flag("h?",["help"],Bool(flag/helpstd/os/flags/flag/help: forall<a> (flag : flag<a>) -> string),"show help information")
.
Automatically generated. Retrieves the help
constructor field of the flagstd/os/flags/flag: V -> V
type.
Automatically generated. Retrieves the long-names
constructor field of the flagstd/os/flags/flag: V -> V
type.
Automatically generated. Retrieves the parser
constructor field of the flagstd/os/flags/flag: V -> V
type.
Automatically generated. Retrieves the short-names
constructor field of the flagstd/os/flags/flag: V -> V
type.
Specifies how to handle flags that follow non-flag command line arguments.
Allow flags to be permuted with non-flag arguments (default).
Flags following non-flag arguments are treated as arguments.
Wrap each non-flag argument into an flag.
Automatically generated. Tests for the Permutestd/os/flags/Permute: forall<a> flag-order<a>
constructor of the flag-orderstd/os/flags/flag-order: V -> V
type.
Automatically generated. Tests for the Preorderstd/os/flags/Preorder: forall<a> flag-order<a>
constructor of the flag-orderstd/os/flags/flag-order: V -> V
type.
Automatically generated. Tests for the Wrapstd/os/flags/Wrap: forall<a> (wrap : (string) -> a) -> flag-order<a>
constructor of the flag-orderstd/os/flags/flag-order: V -> V
type.
Specifies the argument of an flag.
For a flag foo
Automatically enables forms --no-foo
and --foo=true|false
.
An flagal argument.
A required argument.
Automatically generated. Tests for the Bool
constructor of the flag-parserstd/os/flags/flag-parser: V -> V
type.
Automatically generated. Tests for the Optstd/os/flags/Opt: forall<a> (parse : (a, maybe<string>) -> a, help : string) -> flag-parser<a>
constructor of the flag-parserstd/os/flags/flag-parser: V -> V
type.
Automatically generated. Tests for the Reqstd/os/flags/Req: forall<a> (parse : (a, string) -> a, help : string) -> flag-parser<a>
constructor of the flag-parserstd/os/flags/flag-parser: V -> V
type.
Parse the command line arguments args
(see get-args
)
according to the flag descriptions flags
. Takes an flagal argument
ordering
(=Permutestd/os/flags/Permute: forall<a> flag-order<a>
) that specifies how optare handled that follow non-flag arguments.
Returns three lists: the list of parsed flags,
a list of non-flag arguments, and a list of potential error messages.
Return a nicely formatted string describing the usage of a command,
consisting of a header
followed by the descriptions of the flags
.
The default header is "usage:\n program [flags] arguments\n\nflags:"
.
Parsing of command line flags.
For example:
.