You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stjepan Bakrac edited this page May 22, 2020
·
4 revisions
This object represents a type definition for a command handler argument.
Fields
checkfunction
Function to check the argument given to it by the raw command handler. Gets called with the raw string and the argument's options as parameters. Returns the parsed value.
countnumber or string
Tells the raw command handler how many arguments to consume to make this type. Accepts a number or '*' as parameters.
generate_argsfunction
Called when generating the syntax for an argument. Called with the argument's options as parameter and returns the argument type's option parameters as a comma-separated string.
generatefunction
Called when generating the syntax for an argument. Called with the argument's options as parameter and returns the argument type's name.
namestring
The name of the type.
packfunction
Called after the arguments for this type have been parsed. Receives all parsed arguments for this type in an array.
parse_optionsfunction
The function to parse an options definition. Called by command.arg.parse with the comma-separated values inside the parentheses passed in as arguments.
For example, if the type definition is <foo:integer(3,7)> then the function would be called as argument.parse_options(3, 7).