Register callback fn
for the command.
for chaining
Set an alias for the command.
Allow unknown options on the command line.
for chaining
Define argument syntax for the top-level command.
for chaining
Add command name
.
The .action()
callback is invoked when the
command name
is specified via ARGV,
and the remaining arguments are applied to the
function for access.
When the name
is "*" an un-matched command
will be passed as the first arg, followed by
the rest of ARGV remaining.
the new command
Set the description to str
.
Output help information and exit.
Set the name of the command.
Get the name of the command.
Define option with flags
, description
and optional
coercion fn
.
The flags
string should contain both the short and long flags,
separated by comma, a pipe or space. The following are all valid
all will output this way when --help
is used.
"-p, --pepper" "-p|--pepper" "-p --pepper"
for chaining
Return an object containing options as key-value pairs
Output help information for this command.
Parse argv
, settings options and invoking commands when defined.
for chaining
Parse expected args
.
For example ["[type]"]
becomes [{ required: false, name: 'type' }]
.
for chaining
Parse options from argv
returning argv
void of these options.
Set or get the command usage.
Set the program version to str
.
This method auto-registers the "-V, --version" flag which will print the version number when passed.
for chaining
Generated using TypeDoc
Initialize a new
Command
.