Class
Parser
Argument parser class.
Declare arguments used by ARCADES.
Info:
- edit Alexis BRENON alexis.brenon@imag.fr
Metamethods
keyboard_arrow_up-
__init ()
Default constructor
Public Methods
keyboard_arrow_upPrivate Methods
keyboard_arrow_up-
_add_elements ( elements )
Add elements from a table to the parser.
There are 3 different element type:
text
which is just displayed in the usage description;option
that is the top level option (it must be preceded by a dash);field
if it is a suboption that is contained in a table.
Text elements are of the form:
{"text", "my very useful piece of text"}
Option and field elements are of the form:
Parameters:
{"option"|"field", "option_name", default value, "Description", "type"}
-
table
elements
A table representing the element.
-
_format ( description, input )
Parse a string in depth.
Given the description of the arguments and the actual parsing result, it will go deeper, casting string to the right type. This function works recursivelly.
Parameters: Returns:-
table
input
parsed according to thedescription
-
table