import { Command } from "https://deno.land/x/cliffy@v0.16.0/command/mod.ts";
Properties
Methods
Register default options like --version
and --help
.
Handle error. If .throwErrors()
was called all error's will be thrown,
otherwise Deno.exit(1)
will be called.
Execute external sub-command.
Returns the first option which has an action.
Get base type by name.
Get global type by name.
Parse command-line arguments.
Parse raw command line arguments.
Check whether the command should throw errors or exit.
Validate environment variables.
Add new command alias.
Don't throw an error if the command was called without arguments.
Set command arguments:
requiredArg:string [optionalArg: number] [...restArgs:string]
Add new sub-command.
Register command specific custom type.
Set default command. The default command is executed when the program was called without any argument and if no action handler is registered.
Set the long command description.
Add new environment variable.
Add new command example.
Make command executable.
Get command name aliases.
Get arguments definition. E.g: input-file:string output-file:string
Get argument by name.
Get arguments.
Get base command by name.
Get base commands.
Get base completion by name.
Get base completions.
Get base environment variable by name.
Get base environment variables.
Get base option by name.
Get base options.
Get base types.
Get command by name.
Get commands.
Get completion by name.
Get completions.
Get command description.
Get environment variables.
Get example with given name.
Get all examples.
Get global command by name.
Get global commands.
Get global completions by name.
Get global completions.
Get global environment variable by name.
Get global environment variables.
Get global option from parent command's by name.
Get global options.
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 global types.
Get generated help.
Get all arguments defined after the double dash.
Get main command.
Get command name.
Get options.
Get full command path.
Get original command-line arguments.
Get short command description. This is the first line of the description.
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.
Disable help option.
Set help option.
Set help option.
Set command name.
Add a new option.
Parse command line arguments and execute matched command.
Remove sub-command by name.
Remove option by name.
Reset internal command reference to main command.
Set internal command pointer to child command with given name.
Enable stop early. If enabled, all arguments starting from the first non option argument will be passed as arguments with type string to the command action handler.
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 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.
Disable version option.
Set version option.
Set version option.