Module

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

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

Add a new option.

Type Parameters

optional
G extends Record<string, unknown> | void = CG

Parameters

flags: string

Flags string like: -h, --help, --manual requiredArg:string [optionalArg: number] [...restArgs:string]

desc: string

Flag description.

opts: ICommandOption<Partial<CO>, CA, Merge<CG, MapOptionTypes<G>>, PG, P> & { global: true; } | IFlagValueHandler

Flag options or custom handler for processing flag value.

Returns

Command<CO, CA, Merge<CG, MapOptionTypes<G>>, PG, P>

Type Parameters

optional
O extends Record<string, unknown> | void = CO

Parameters

flags: string
desc: string
optional
opts: ICommandOption<Merge<CO, MapOptionTypes<O>>, CA, CG, PG, P> | IFlagValueHandler

Returns

Command<Merge<CO, MapOptionTypes<O>>, CA, CG, PG, P>