Skip to main content

Interface: ObjectOptionConfig<TCoerce, TProperties>

Extends

Type Parameters

TCoerce = Record<string, string>

TProperties extends object = Record<string, any>

Properties

additionalProperties?

optional additionalProperties: false | "string" | "number" | "boolean"

Defined in

packages/parser/src/lib/option-types/object.ts:13


alias?

optional alias: string[]

Provide an array of aliases for the option.

Inherited from

Omit.alias

Defined in

packages/parser/src/lib/option-types/common.ts:25


coerce()?

optional coerce: (value) => TCoerce

Provide a function to coerce the value of the option.

Parameters

value: Record<string, string>

Value of the option

Returns

TCoerce

Coerced value of the option

Inherited from

Omit.coerce

Defined in

packages/parser/src/lib/option-types/common.ts:49


default?

optional default: Default<Record<string, string>>

Provide a default value for the option.

If the default value is a tuple, the first value will be used as the default value, and the second value will be used as the description.

Inherited from

Omit.default

Defined in

packages/parser/src/lib/option-types/common.ts:37


deprecated?

optional deprecated: string

If set, the option will be marked as deprecated, with the provided message. This will not effect runtime behavior, but will be displayed in help output and generated docs.

Inherited from

Omit.deprecated

Defined in

packages/parser/src/lib/option-types/common.ts:101


description?

optional description: string

Provide a description for the option.

Inherited from

Omit.description

Defined in

packages/parser/src/lib/option-types/common.ts:42


env?

optional env: string | boolean | object

If set, the option will be populated from the environment variable ${env}_${optionName}. If set to true, the environment variable will be ${optionName}. If explicitly set to false, environment variable population will be disabled for this option.

Inherited from

Omit.env

Defined in

packages/parser/src/lib/option-types/common.ts:68


group?

optional group: string

Can be set to group options in help output and generated docs.

Inherited from

Omit.group

Defined in

packages/parser/src/lib/option-types/common.ts:111


hidden?

optional hidden: boolean

If true, the option will not be displayed in help output or generated docs.

Inherited from

Omit.hidden

Defined in

packages/parser/src/lib/option-types/common.ts:106


positional?

optional positional: boolean

If set to true, the option will be treated as a positional argument.

Inherited from

Omit.positional

Defined in

packages/parser/src/lib/option-types/common.ts:20


properties

properties: TProperties

Defined in

packages/parser/src/lib/option-types/object.ts:12


required?

optional required: boolean

If true, the option is required.

Inherited from

Omit.required

Defined in

packages/parser/src/lib/option-types/common.ts:61


type

type: "object"

Defined in

packages/parser/src/lib/option-types/object.ts:10


validate()?

optional validate: (value) => string | boolean

Provide a function to validate the value of the option.

Parameters

value: TCoerce

Coerced value of the option

Returns

string | boolean

If the value is valid, return true. If the value is invalid, return false or a string with an error message.

Inherited from

Omit.validate

Defined in

packages/parser/src/lib/option-types/common.ts:56