Function: generate()
Generate the command usage.
Signature
ts
export async function generate<G extends GunshiParamsConstraint = DefaultGunshiParams>(command: string | string[] | null, entry: Command<G> | LazyCommand<G>, options: GenerateOptions<G> = {}): Promise<string>Type Parameters
| Name | Description |
|---|---|
G extends GunshiParamsConstraint = DefaultGunshiParams | A type extending GunshiParams to specify the shape of command parameters. |
Parameters
| Name | Type | Description |
|---|---|---|
command | string | string[] | null | usage generate command, if you want to generate the usage of the default command where there are target commands and sub-commands, specify null. |
entry | Command<G> | LazyCommand<G> | A entry command |
options | GenerateOptions<G> | A cli options (optional, default: {}) |
Returns
Promise<string> — A rendered usage.
