|
Awkl
|
Functions | |
| unassigned | parser (array P, string name, string version, string description, prefix, long_prefix, auto_help, auto_version) |
| Create command-line argument parser. | |
| unassigned | argument (array P, string name, string args, string help, number nargs, any default, any implicit, string action) |
| Add option argument to parser. | |
| unassigned | flag (array P, string name, string args, string help, string action) |
| Add boolean option (flag) to parser. | |
| unassigned | param (array P, string name, string args, string help, any default, string action) |
| Add option with 1 argument to parser. | |
| unassigned | option (array P, string name, string args, string help, any default, any implicit, string action) |
| Add option with optional argument to parser. | |
| unassigned | counter (array P, string name, string args, string help, any default, number inc) |
| Add counter option to parser. | |
| string | generateSynopsis (array P, string|number color, number ind1n) |
| Generate command synopsis usage message from a parser. | |
| string | generateHelp (array P, string|number color, number desc_margin, number ind1n) |
| Generate help usage message from a parser. | |
| auto | showHelp (O, R, P) |
| Action for showing help message. | |
| auto | showVersion (O, R, P) |
| Action for showing version. | |
| auto | setDefaults (R, P) |
| Set default values to a result array from a parser. | |
| bool | get (array O, array P, array< string > argv, number argc) |
| Get results of analyzing the next option argument from a parser. Iterator function. | |
| number | parse (array P, array R, array< string > argv, number argc) |
| Parse a result array from a parser and command-line arguments. | |
| auto | count (O, R, P) |
| Action for counting number of times passed. | |
| unassigned opt::argument | ( | array | P, |
| string | name, | ||
| string | args, | ||
| string | help, | ||
| number | nargs, | ||
| any | default, | ||
| any | implicit, | ||
| string | action ) |
Add option argument to parser.
| [in,out] | P | Command-line argument parser |
| name | Name of the option argument | |
| args | Blank separated list of strings (e.g. -a --alpha) the option corresponds to | |
| help | Help message for the option | |
| nargs | Number of arguments the option takes | |
| default | Default value for the option: The value when it is not passed | |
| implicit | Implicit value for the option: The value when it is passed with no argument | |
| action | Function name of an action to take when parsing the option |
| auto opt::count | ( | O | , |
| R | , | ||
| P | ) |
Action for counting number of times passed.
| unassigned opt::counter | ( | array | P, |
| string | name, | ||
| string | args, | ||
| string | help, | ||
| any | default, | ||
| number | inc ) |
Add counter option to parser.
| [in,out] | P | Command-line argument parser |
| name | Name of the option argument | |
| args | Blank separated list of strings (e.g. -a --alpha) the option corresponds to | |
| help | Help message for the option | |
| default | Default value for the option: The value when it is not passed | |
| inc | Incrementing step |
| unassigned opt::flag | ( | array | P, |
| string | name, | ||
| string | args, | ||
| string | help, | ||
| string | action ) |
Add boolean option (flag) to parser.
| [in,out] | P | Command-line argument parser |
| name | Name of the option argument | |
| args | Blank separated list of strings (e.g. -a --alpha) the option corresponds to | |
| help | Help message for the option | |
| action | Function name of an action to take when parsing the option |
| string opt::generateHelp | ( | array | P, |
| string|number | color, | ||
| number | desc_margin, | ||
| number | ind1n ) |
Generate help usage message from a parser.
| P | Command-line argument parser |
| color | Color to use. No color by default, cyan if 1 |
| desc_margin | Number of spaces to separate help descriptions |
| ind1n | Number of spaces to indent with |
| string opt::generateSynopsis | ( | array | P, |
| string|number | color, | ||
| number | ind1n ) |
Generate command synopsis usage message from a parser.
| P | Command-line argument parser |
| color | Color to use. No color by default, cyan if 1 |
| ind1n | Number of spaces to indent with |
| bool opt::get | ( | array | O, |
| array | P, | ||
| array< string > | argv, | ||
| number | argc ) |
Get results of analyzing the next option argument from a parser. Iterator function.
| [out] | O | Running results of option parsing with the following keys:
|
| [in] | P | Command-line argument parser |
| argv | Array of CLI arguments to parse | |
| argc | Number of CLI arguments to parse |
| unassigned opt::option | ( | array | P, |
| string | name, | ||
| string | args, | ||
| string | help, | ||
| any | default, | ||
| any | implicit, | ||
| string | action ) |
Add option with optional argument to parser.
| [in,out] | P | Command-line argument parser |
| name | Name of the option argument | |
| args | Blank separated list of strings (e.g. -a --alpha) the option corresponds to | |
| help | Help message for the option | |
| default | Default value for the option: The value when it is not passed | |
| implicit | Implicit value for the option: The value when it is passed with no argument | |
| action | Function name of an action to take when parsing the option |
| unassigned opt::param | ( | array | P, |
| string | name, | ||
| string | args, | ||
| string | help, | ||
| any | default, | ||
| string | action ) |
Add option with 1 argument to parser.
| [in,out] | P | Command-line argument parser |
| name | Name of the option argument | |
| args | Blank separated list of strings (e.g. -a --alpha) the option corresponds to | |
| help | Help message for the option | |
| default | Default value for the option: The value when it is not passed | |
| action | Function name of an action to take when parsing the option |
| number opt::parse | ( | array | P, |
| array | R, | ||
| array< string > | argv, | ||
| number | argc ) |
Parse a result array from a parser and command-line arguments.
| [out] | P | Command-line argument parser |
| [out] | R | Result array whose keys are the parser's options' names, or _error if an unrecognized option was passed |
| argv | Array of strings of the command-line arguments | |
| argc | Optional |
argv where positional parameters start | unassigned opt::parser | ( | array | P, |
| string | name, | ||
| string | version, | ||
| string | description, | ||
| prefix | , | ||
| long_prefix | , | ||
| auto_help | , | ||
| auto_version | ) |
Create command-line argument parser.
| [out] | P | Command-line argument parser |
| name | Name of the CLI program | |
| version | Version of the CLI program | |
| description | Short description of the CLI program |
| auto opt::setDefaults | ( | R | , |
| P | ) |
Set default values to a result array from a parser.
| auto opt::showHelp | ( | O | , |
| R | , | ||
| P | ) |
Action for showing help message.
| auto opt::showVersion | ( | O | , |
| R | , | ||
| P | ) |
Action for showing version.