Closed moustacheful closed 8 years ago
Given the following task
vorpal .command('greet', 'Greets something') .option('--target', 'Who to greet', ['Jimmy', 'Bob', 'Jon']) .action(function (args) { this.log('Hello', args.options.target); return Promise.resolve(); });
Upon attempting execution and successfully getting the autocomplete options, the arguments list the option as true instead of the intended value.
true
eg:
$greet --target Jim[tab] $greet --target Jimmy
Which logs the following as a result:
Hello true
This is the case regardless if option is given an array / function / promise Am I doing something wrong? docs error maybe?
option
Reminder to self: RTFM Didn't realize the option definition needed an optional or required parameter if you need the value.
My bad!
Given the following task
Upon attempting execution and successfully getting the autocomplete options, the arguments list the option as
true
instead of the intended value.eg:
Which logs the following as a result:
This is the case regardless if
option
is given an array / function / promise Am I doing something wrong? docs error maybe?