metis.argparse
A really basic argument parser.
| create() | Create a new argument parser. |
|---|
Types
ArgParser
A collection of arguments, and a parser for them.
- ArgParser.add(names, options)Source
Add a new argument which is accepted by this parser.
Parameters
- names
string| {string... } The names of this argument. These may be prefixed with "--" or "-" (i.e. "--foo") to mark this as an option, or left raw to be considered a positional argument. - options { action? = function(
table,table,string), name? =string, required? =boolean, mvar? =string, doc? =string} Additional options for this argument.
- names
- ArgParser.parse(...)Source
Parse a series of arguments according to the previously given options.
Parameters
- ...
stringThe arguments to parse, as given to the program.
Returns
tableThe result of argument parsing.
Throws
If invalid arguments were given.
- ...