Refactor options sets to:
public optionSets: OptionSet[] {
return [
{
options: ['option1', 'option2'],
runsWhen: (args) => args.options.option3 !== undefined // dependant
},
{
options: ['option3', 'option4'] // will run always, default
},
{
options: ['option5', 'option6'],
runsWhen: (args) => args.options.option5 || args.options.option6 // exclusive + optional options
}
];
}
The runsWhen property is optional. When not specified, the option set will be validated. When specified, it will evaluate the specified function and validate the option set only when the function returned true.
Refactor options sets to:
The
runsWhenproperty is optional. When not specified, the option set will be validated. When specified, it will evaluate the specified function and validate the option set only when the function returned true.