Module

x/cliffy/command/command.ts>Command#command

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
method Command.prototype.command
import { Command } from "https://dotland.deno.dev/x/cliffy@v0.19.2/command/command.ts";

Add new sub-command.

Type Parameters

C extends (CO extends number ? Command : Command<Record<string, any> | void, Array<unknown>, Record<string, any> | void, Merge<PG, CG> | void | undefined, OneOf<P, this> | undefined>)

Parameters

name: string

Command definition. E.g: my-command <input-file:string> <output-file:string>

cmd: C

The new child command to register.

optional
override: boolean

Override existing child command.

Returns

C extends Command<infer O, infer A, infer G, any, any> ? Command<O, A, G, Merge<PG, CG>, OneOf<P, this>> : never

Add new sub-command.

Type Parameters

optional
A extends Array<unknown> = Array<any>

Parameters

name: string

Command definition. E.g: my-command <input-file:string> <output-file:string>

optional
desc: string

The description of the new child command.

optional
override: boolean

Override existing child command.

Returns

Command<CO extends number ? any : void, MapArgumentTypes<A>, CO extends number ? any : void, Merge<PG, CG>, OneOf<P, this>>