Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Options

Hierarchy

  • Options

Index

Properties

Optional alias

alias: string | ReadonlyArray<string>

string or array of strings, alias(es) for the canonical option key, see alias()

Optional array

array: undefined | false | true

boolean, interpret option as an array, see array()

Optional boolean

boolean: undefined | false | true

boolean, interpret option as a boolean flag, see boolean()

Optional choices

choices: Choices

value or array of values, limit valid option arguments to a predefined set, see choices()

Optional coerce

coerce: undefined | ((arg: any) => any)

function, coerce or transform parsed command line values into another value, see coerce()

Optional config

config: undefined | false | true

boolean, interpret option as a path to a JSON config file, see config()

Optional configParser

configParser: undefined | ((configPath: string) => object)

function, provide a custom config parsing function, see config()

Optional conflicts

conflicts: string | ReadonlyArray<string> | {}

string or object, require certain keys not to be set, see conflicts()

Optional count

count: undefined | false | true

boolean, interpret option as a count of boolean flags, see count()

Optional default

default: any

value, set a default value for the option, see default()

Optional defaultDescription

defaultDescription: undefined | string

string, use this description for the default value in help content, see default()

Optional demand

demand: boolean | string
deprecated

since version 6.6.0 Use 'demandOption' instead

Optional demandOption

demandOption: boolean | string

boolean or string, demand the option be given, with optional error message, see demandOption()

Optional desc

desc: undefined | string

string, the option description for help content, see describe()

Optional describe

describe: undefined | string

string, the option description for help content, see describe()

Optional description

description: undefined | string

string, the option description for help content, see describe()

Optional global

global: undefined | false | true

boolean, indicate that this key should not be reset when a command is invoked, see global()

Optional group

group: undefined | string

string, when displaying usage instructions place the option under an alternative group heading, see group()

Optional hidden

hidden: undefined | false | true

don't display option in help output.

Optional implies

implies: string | ReadonlyArray<string> | {}

string or object, require certain keys to be set, see implies()

Optional nargs

nargs: undefined | number

number, specify how many arguments should be consumed for the option, see nargs()

Optional normalize

normalize: undefined | false | true

boolean, apply path.normalize() to the option, see normalize()

Optional number

number: undefined | false | true

boolean, interpret option as a number, number()

Optional require

require: boolean | string
deprecated

since version 6.6.0 Use 'demandOption' instead

Optional required

required: boolean | string
deprecated

since version 6.6.0 Use 'demandOption' instead

Optional requiresArg

requiresArg: undefined | false | true

boolean, require the option be specified with a value, see requiresArg()

Optional skipValidation

skipValidation: undefined | false | true

boolean, skips validation if the option is present, see skipValidation()

Optional string

string: undefined | false | true

boolean, interpret option as a string, see string()

Optional type

type: "array" | "count" | PositionalOptionsType