Used on a command definition to define option flags.

### Hierarchy

- ICommandOptionDefinition

## Index

### Properties

- absenceImplications
- aliases
- allowableValues
- arrayAllowDuplicate
- conflictsWith
- defaultValue
- description
- group
- hidden
- implies
- impliesOneOf
- name
- numericValueRange
- required
- stringLengthRange
- type
- valueImplications

## Properties

### Optional absenceImplications

absenceImplications: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:150

Not specifying these options implies that you should specify all options listed in "absenceImplications".

e.g. if the user does not specify "vacation" then they must specify --job and --hours

memberof

  ICommandOptionDefinition

### Optional aliases

aliases: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:60

Aliases for your option. These allow the user to specify the option with a shorter or otherwise alternate name e.g. name: "puppy", aliases: ["p", "pup"] - the user can specify --puppy, -p, or --pup

memberof

  ICommandOptionDefinition

### Optional allowableValues

allowableValues: ICommandOptionAllowableValues

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:158

What values can be specified for this option? See the type below for more details.

memberof

  ICommandOptionDefinition

### Optional arrayAllowDuplicate

arrayAllowDuplicate: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:185

If the type is array, this option defines if duplicate values in array are allowed. Default is true.

memberof

  ICommandOptionDefinition

### Optional conflictsWith

conflictsWith: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:121

Defines which options this one conflicts with.

example
  A and B can't be specified together
  const def: ICommandOptionDefinition = { name: "B", description conflictsWith: ["A"] }
memberof

  ICommandOptionDefinition

### Optional defaultValue

defaultValue: any

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:86

If the user doesn't specify this option, you can specify a default value here that will be filled in automatically.

memberof

  ICommandOptionDefinition

### description

description: string

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:67

The description of your option - displayed in the help text for your command.

memberof

  ICommandOptionDefinition

### Optional group

group: string

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:94

The group/category for this option. Options with the same group on the same command are grouped together under a heading with this text.

memberof

  ICommandOptionDefinition

### Optional hidden

hidden: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:79

Option is hidden from help

memberof

  ICommandOptionDefinition

### Optional implies

implies: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:130

If this option is specified, all options whose name appear in the "implies" field must also be specified. e.g. if this option is "vacation", and ["seat", "meal"] is the value for "implies", then the user will get a syntax error if they specify --vacation but not --seat and --meal

memberof

  ICommandOptionDefinition

### Optional impliesOneOf

impliesOneOf: string[]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:140

If this option is specified, at least one of the options whose name appear in the "impliesOneOf" field must also be specified. e.g. if this option is "vacation", and ["seat", "meal"] is the value for "impliesOneOf", then the user will get a syntax error if they specify --vacation but not either --seat or --meal

memberof

  ICommandOptionDefinition

### name

name: string

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:51

The canonical/primary name for your option. This is the first form of the option shown to the user and is generally how you should refer to your option in documentation and programmatically.

Note: yargs automatically places the values for --hyphenated-options in a camelCase format after parsing the command line arguments, so you would be able to access params.arguments.hyphenatedOptions from your handler as well as params.arguments["hyphenated-options"]'

memberof

  ICommandOptionDefinition

### Optional numericValueRange

numericValueRange: [number, number]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:168

Acceptable value range for number type options. the first number is the minimum. the second is the maximum So the value specified by the user must be min <= value <= max

memberof

  ICommandOptionDefinition

### Optional required

required: boolean

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:105

Is this option required? If it's required and the user does not specify it, they will get a syntax error.

Note: if you give a defaultValue to an option, it will always be considered to have been specified.

memberof

  ICommandOptionDefinition

### Optional stringLengthRange

stringLengthRange: [number, number]

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:177

Acceptable length range for string type options. the first number is the minimum. the second is the maximum So the length specified by the user must be min <= length <= max

memberof

  ICommandOptionDefinition

### type

type: CommandOptionType

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:73

What type of value will the user specify for this option?

memberof

  ICommandOptionDefinition

### Optional valueImplications

valueImplications: {}

- Defined in @zowe/imperative/src/cmd/src/doc/option/ICommandOptionDefinition.ts:192

If the user specifies a certain value for this option, then they must also specify other options (similar to a conditional "implies")

memberof

  ICommandOptionDefinition

#### Type declaration

- ##### [key: string]: ICommandOptionValueImplications

Generated using TypeDoc