interface ICli
A command-line interface created by the cli function.
Methods
command(command, description, options, handler)
Register a command.
Name | Type | Description |
---|---|---|
|
|
The command string. Use |
|
|
The command description, the text to show in |
|
|
The options accepted by the command. See yargs API documentation for details. |
|
|
The command handler. It may return a promise. If the promise is rejected, the CLI will exit with the help text and a non-zero code. |
Returns |
|
An instance of ICli for chaining. |
Signature
command<LocalOptions extends {
[key: string]: yargs.Options;
}>(command: string | ReadonlyArray<string>, description: string, options: LocalOptions, handler: (args: CliArguments<LocalOptions>) => void): ICli<GlobalOptions>;