ICli.command() MethodSignature
Register a command.
Signature
command<LocalOptions extends {
[key: string]: yargs.Options;
}>(command: string | ReadonlyArray<string>, description: string, options: LocalOptions, handler: (args: CliArguments<LocalOptions>) => void): ICli<GlobalOptions>;
Parameters
Parameter | Type | Description |
---|---|---|
command | string | ReadonlyArray<string> | The command string. Use |
description | string | The command description, the text to show in |
options | LocalOptions | The options accepted by the command. See yargs API documentation for details. |
handler | (args: CliArguments<LocalOptions>) => void | 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) | ICli<GlobalOptions> | An instance of ICli for chaining. |