import { Command } from "https://deno.land/x/cliffy@v0.14.0/mod.ts";
Base command implementation without pre configured command's and option's.
Properties
Methods
Execute external sub-command.
Execute help command if help flag is set.
Match commands and arguments from command line arguments.
Parse command line args.
Validate environment variables.
Add new command alias.
Don't throw an error if the command was called without arguments.
Set command arguments.
Add new sub-command.
Register command specific custom type.
Set default command. The default command will be called if no action handler is registered.
Set command description.
Add new environment variable.
Handle error. If .throwErrors()
was called all error's will be thrown, otherwise Deno.exit(1)
will be called.
Add new command example.
Make command executable.
Get command name aliases.
Get arguments definition.
Get argument.
Get arguments.
Get base option by name.
Get sub-command with given name.
Get sub-commands.
Get command description.
Get environment variable with given name.
Get environment variables.
Get example with given name.
Get examples.
Get global option from parent command's by name.
Get parent command from global executed command. Be sure, to call this method only inside an action handler. Unless this or any child command was executed, this method returns always undefined.
Get generated help.
Get main command.
Get command name.
Get full command path of all parent command names and current command name.
Get command version.
Make command globally available.
Check if command has arguments.
Checks whether the command has a sub-command with given name or not.
Checks whether the command has sub-commands or not.
Checks whether the command has an environment variable with given name or not.
Checks whether the command has environment variables or not.
Checks whether the command has an example with given name or not.
Checks whether the command has examples or not.
Checks whether the command has an option with given name or not.
Checks whether the command has options or not.
Output generated help without exiting.
Get or set command name.
Add new option (flag).
Parse command line arguments and execute matched command.
Remove sub-command with given name.
Remove option by name.
Reset internal command reference to main command.
Reset internal command reference to child command with given name.
If enabled, all arguments starting from the first non option argument will be interpreted as raw argument.
For example:
command --debug-level warning server --port 80
Will result in:
- options: {debugLevel: 'warning'}
- args: ['server', '--port', '80']
Throw error's instead of calling Deno.exit()
to handle error's manually.
This has no effect for parent commands. Only for the command on which this method was called and all child commands.
Register command specific custom type.
Disable parsing arguments. If enabled the raw arguments will be passed to the action handler. This has no effect for parent or child commands. Only for the command on which this method was called.
Set command version.