Skip to main content

Param <T>

Hierarchy

Index

Properties

optionaldefault

default?: T

The default value if option not provided on the command line. The value's type is dependent on the type and multiple settings. Furthermore, this value defaults to the following if not defined.

  • A zero (0) when type is number.
  • An empty string ('') when type is string.
  • And false when type is boolean.

optionaldeprecated

deprecated?: boolean

Whether the object is deprecated or not. Will display a tag in the help menu. Defaults to false.

description

description: string

A description of what the object is and does. Supports basic markdown for bold, italics, and underline.

optionalformat

format?: (value: T) => T

An optional function to format the value after parsing. Must return the same type.

optionalhidden

hidden?: boolean

Whether the object should be hidden from the help menu or not. Will still match on the command line. Defaults to false.

optionallabel

label?: string

Informational label to display in terminal output.

optionalrequired

required?: boolean

Whether the param is required or not. If required and not passed, the parser will throw an error. Defaults to false.

type

type: InferArgType<T>

Expected type of the provided value. When a value is captured from the command line, it will be type casted.

optionalvalidate

validate?: (value: T) => void

An optional function to validate the provided value.