Arg package:parseargs
The description of an argument, suitable for messages and for parsing.
The
argData field is used both for flags with a data argument,
and for positional data arguments.
There are two cases:
- The argument is a flag, in which case at least one of
argAbbr and argName is provided;
- The argument is positional, in which case neither argAbbr
nor argName are provided, but argData is.
If none of
argAbbr,
argName, or
argData are
provided, this is an error. See also the
argDataRequired,
argDataOptional, and
argDataDefaulted functions below,
which are used to generate
argData.
ArgType instance for opening a file from its string name.
Type of values that can be parsed by the argument parser.
The data structure
parseArgs produces. There is a
should-be-hidden field that describes the parse.
How "sloppy" the parse is.
Any extraneous arguments (unparseable from description) will cause the
parser to fail.
Whether to always treat an unknown argument beginning with "-" as an
error, or to allow it to be used as a positional argument when
possible.
If an argument begins with a "-", it will always be treated as an
error unless it corresponds to a flag description.
All extraneous arguments are permitted, and will be skipped, saved,
and returned.
Record containing the collective parse control information.
If an argument beginning with a "-" is unrecognized as a flag, treat
it as a positional argument if possible. Otherwise it is an error.
Trailing extraneous arguments are permitted, and will be skipped,
saved, and returned. The constructor argument is the name of the args.
The types of an argument carrying data. The constructor argument is
used to carry a default value.
The constructor argument should really be hidden. Values of this type
are normally constructed within the pseudo-constructors
pseudo-constructors
argDataRequired,
argDataOptional,
and
argDataDefaulted, to which only the constructor function
itself is passed.
Generate the
argData for the given optional argument with the
given default.