metis.argparse

A really basic argument parser.

create()Create a new argument parser.
create()Source

Create a new argument parser.

Returns

  1. ArgParser The constructed 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

  1. 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.
  2. options { action? = function(table, table, string), name? = string, required? = boolean, mvar? = string, doc? = string } Additional options for this argument.
ArgParser.parse(...)Source

Parse a series of arguments according to the previously given options.

Parameters

  1. ... string The arguments to parse, as given to the program.

Returns

  1. table The result of argument parsing.

Throws

  • If invalid arguments were given.