Optional_Holds the name used in CLI to create the node, in case an alias was used. It could be the same as name.
arguments for this node
As is verbatim CLI args that were consumbed by this node
Associated Command data
Command consumes all remaining arguments blindly
command/option name
If this is a command node, then it can have options
sub command nodes
get the arguments for this command
Get the command chain (sequence from root to this command, including itself)
Array of CommandNodes from root to this command
get the options with full values for this command
get the options for this command
Get the root command by traversing up the parent chain until no more parent exists.
The root CommandNode
Add an arg to this node
Add a sub command to this node
node for the new command
Add a option to this node
node for the new option
Allow you to apply extra config to the parsed object, overriding any opts with source not start with cli.
For example, you can allow user to specify options in their package.json file, and apply those after the command line is parsed.
Each key goes to this command and any parsed sub command that declares the option. Keys that match no declared option are ignored.
Config object containing user options config
Name of the source that provided the config. Default to user
check for missing options that are required
Get array of all commands that have exec callback
Root command execution is handled specially:
Array to accumulate command nodes with exec handlers
Whether to recursively include sub-commands
Array of command nodes that have exec handlers (excluding root command)
Invoke the command's exec handler
if true, then also do sub commands
Optionalparsed: ParseResult
The parsed result containing remaining args after --
Optionalparsed: ParseResult
The parsed result containing remaining args after --
For options that has names with - in them, add it using its name converted to camelCase.
Object representation for an instance of a command on the CLI