Optional ReadonlyallowableOptional list of values that the value must match. This is not supported for ArgumentValueTypeName.BOOLEAN.
Optional ReadonlyconfigurationOptional configuration key to use for the argument. Must consist of alphanumeric non-whitespace uppercase
ASCII or _ characters. Must not start with a digit.
If not specified a default configuration key is determined as follows: The SubCommandArgument.name is capitalized
and any - characters are replaced with _ characters. If the result starts with a digit, it is
prefixed with _. Some examples:
FooBar => configuration key: FOOBARHello-World- => configuration key: HELLO_WORLD_3 => configuration key: _3NOTE: Regardless of whether a configurationKey is specified, or the default is relied upon,
it will only be used if the parent Command has specified Command.enableConfiguration as true.
Optional ReadonlydescriptionOptional description of the argument.
Optional ReadonlyisOptional (default is false) for ArgumentValueTypeName.STRING when comparing a value against allowableValues.
Optional ReadonlyisIf this is true the argument can be specified one or multiple times and all values will be returned in
an array matching the order provided.
NOTE: If isVarargOptional is true, the argument can specified zero, one or multiple times.
NOTE: There can be only one positional with this set and it must be the last the last item if there are multiple positionals defined.
Optional ReadonlyisIf this is true the argument can be specified zero or once i.e. it does not need to be specified.
NOTE: If isVarargMultiple is true, the argument can specified zero, one or multiple times.
NOTE: There can be only one positional with this set and it must be the last the last item if there are multiple positionals defined.
Optional ReadonlymaxOptional for ArgumentValueTypeName.INTEGER or ArgumentValueTypeName.NUMBER when validating a value.
Optional ReadonlyminOptional for ArgumentValueTypeName.INTEGER or ArgumentValueTypeName.NUMBER when validating a value.
ReadonlynameName of the argument.
Must consist of alphanumeric non-whitespace ASCII or _ and - characters. Cannot start with -.
ReadonlytypeType of the argument value.
Optional ReadonlyvalidateOptional custom validation function invoked after all built-in validation has passed. Receives the validated and type-converted value.
Return undefined if the value is valid, or a string describing the
validation error. The error string is associated with
InvalidArgumentReason.CUSTOM_VALIDATION.
Example: ensure array values are unique:
validate: (value) => {
const arr = value as string[];
return new Set(arr).size !== arr.length
? "values must be unique"
: undefined;
}
Interface for SubCommand positional arguments.