Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/opinecli/deps.ts>Command#command

Opine's application generator
Latest
method Command.prototype.command
Re-export
import { Command } from "https://deno.land/x/opinecli@2.0.0/deps.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>>