Skip to content

CommandOpts

@tsed/cli-core

Usage

typescript
import { CommandOpts } from "@tsed/cli-core";

See /packages/cli-core/src/interfaces/CommandOptions.ts.

Overview

ts
interface CommandOpts {
    description: string;
    type?: Type<any>;
    itemType?: Type<any>;
    defaultValue?: string | number | boolean | any;
    required?: boolean;
    customParser?: (value: any) => any;
}

description

ts
description: string;

Description of the commander.option()

type

ts
type?: Type<any>;

Use type to parse the option (String, Number, Boolean, Array)

itemType

ts
itemType?: Type<any>;

Use item type to parse items

defaultValue

ts
defaultValue?: string | number | boolean | any;

Default value

required

ts
required?: boolean;

Define a require option

customParser:

ts
customParser?: (value: any) => any;

Use a custom Parser

Released under the MIT License.