Error : Handles error messages.
Exec : Parses arguments then executes command action if any.
If : Alias for when.
Listen : Parses arguments then executes command action if any.
Max : Gets methods for adding max commands or options.
Max Commands Sets maximum command count.
the maximum number of commands.
Max Options Sets maximum option count.
the maximum number of options.
Min : Gets methods for adding min commands or options.
Min Commands Sets minimum command count.
the minimum number of commands.
Min Options Sets minimum option count.
the minimum number of options.
Parse : Parses the provided arguments inspecting for commands and options.
Action Adds an action event to be called when parsing matches command.
the callback function when parsed command matches.
Alias Maps alias keys to option/argument key.
object map containing aliases.
Alias Maps alias keys to option/argument key.
the key to map alias keys to.
keys to map as aliases.
Alias To Name Maps an alias key to primary command/flag name.
the key to map to name.
default value if alias is not found.
Aliases Looks up aliases for a given key.
the primary key to find aliases for.
Argument Adds sub command argument to command. Wrapped with [arg] if [] or <> not detected.
Supported to type strings: string, date, array, number, integer, float, json, regexp, boolean
the option token to parse as option.
the description for the option.
an optional default value.
a string type, RegExp to match or Coerce method.
Cast To Type Casts a value to the specified time or fallsback to default.
the type to cast to.
the value to be cast.
Clean : Filters arrays deletes keys from objects.
the key name to be cleaned.
Coerce Coerce or transform the defined option/argument when matched.
object containing coerce configurations.
Coerce Coerce or transform the defined option when matched.
the option key to be coerced.
the string type, RegExp or coerce callback function.
an optional value when coercion fails.
Command A string containing Parv tokens to be parsed.
the command token string to parse.
a description describing the command.
Completion At : Injects custom completion value for specified key. Key can be a know command, option or * for anonymous.
the key to inject completion values for.
the completion values for the provided key.
CWD : Sets the working directory prepended to external commands/programs. Ignored when action is present. TODO: Not sure I like this need to play with it more.
the base path when command is external program.
Default Sets a default value for a sub command arg or option.
an object containing configs for property defaults.
Default Sets a default value for sub command arg or option.
the key to set default value for.
the value to set for the provided key.
Demand The commands or option/argument keys to demand.
additional keys to demand.
Describe Adds description for an option/argument.
object containing describes by property.
Describe Adds description for an option/argument.
the option key to add description to.
the associated description.
Epilog Displays trailing message.
the trailing epilogue to be displayed.
Example : Saves an example string for the command or tuple consisting of example string and description.
string or an array of tuples [example, description].
the description for the example.
Expand Option This breaks out the parsed option in to several arrays/objects. This prevents some recursion rather than storing the object itself in turn requiring more loops.
the parsed PargvOption object.
Extend Aliases When true option aliases are extended on result object --option, -o results in { option: value, o: value }.
when true aliases are exteneded on Pargv result object.
Extend Commands When true known commands are extended to result object { some_command: value }.
when true commands are exteneded on Pargv result object.
when true commands are exteneded on Pargv result object.
Help Enables or disables help for this command.
true or false to toggle help.
Is Bool Looks up flag option check if is of type boolean.
the option key to check.
Is Command Checks if a command exists by index or name.
the command string or index.
Has Option Inspects if key is known option.
Is Required Checks if command or option is required.
the command, index or option key.
Max Commands Specifies the maxium commands allowed.
the number of command arguments allowed.
Max Options Specifies the maxium options allowed.
the number of options allowed.
Min Commands Specifies the minimum commands required.
the number of command arguments required.
Min Options Specifies the minimum options required.
the number of options required.
On Error Add custom on error handler.
the error handler function.
On Help Method for adding custom help handler, disabling. If custom handler return compiled help to be displayed or false to handle manually.
boolean to enable/disable, or function for custom help.
On Log Add custom on log handler.
the log handler function.
Option Adds option to command.
Supported types: string, date, array, number, integer, float, json, regexp, boolean
the option token to parse as option.
the description for the option.
an optional default value.
a string type, RegExp to match or Coerce method.
Parse Command Parses a command token.
the command token string to parse.
Parse Token Parses a usage token.
the token string to be parsed.
the next element in usage command.
Rebuild Usage Rebuilds the auto generated usage string.
Spawn Action : When defined externally spawned commands will call this action.
the SpawnOptions for child_process spawn.
external spawn action handler.
Spread Commands When true found commands are spread in .action(cmd1, cmd2, ...).
when true spreads command args in callback action.
when true spreads command args in callback action.
Stats Iterates arguments mapping to known options and commands finding required, anonymous and missing args.
the args to get stats for.
when true deamnds and whens are not built.
Strip To Alias Strips tokens then returns alias or original key.
the key to retrieve alias for.
Toggle Help Enables or disables help while toggling the help option.
whether or not help is enabled.
Usage Usage is generated automatically, this method allows override of the internal generated usage.
the value to display for command usage.
When When a specified key demand dependent key.
an object containing when configurations.
When When a specified key demand dependent key.
require this key.
this key is present.
When When a specified key demand dependent key.
require this key.
this key is present.
when true the coverse when is also created.
Generated using TypeDoc
Completion : Adds the completion command for use within your app for generating completion script.