Closed hrbu closed 8 years ago
What happens if you edit your command like this:
vorpal
.command('logs <cluster>')
.option('-v, --verbose', 'Show details.')
.option('--tail [amount]', 'Number of lines to show from the end of the logs for each container.')
Can you please try this and post the result?
vorpal parsed args:
{ options: { tail: 100}, cluster: 'dev' }
OK. When providing a parameter for the option, vorpal parses the value as expected. I would prefer any option declaration without parameter to be handled as an optional one.
@hrbu this creates additional problems, and this is why this change was actually a bug fix. Is it possible to simply amend your app to include declaring the parameters? Thanks.
Yes, possible. Thanks for your support.
Since version 1.10.0 vorpal seems to have a bug when parsing options from the passed arguments. Until v1.9.7 it works as expected. Since v1.10.0 (including the currently latest v1.11.3) the values of options are not parsed correctly.
I have a command like this ...
vorpal-1.9.7
passed args:
vorpal parsed args:
{ options: { tail: 100 }, cluster: 'dev' }
vorpal-1.10.0
passed args:
vorpal parsed args:
{ options: { tail: true }, cluster: 'dev' }
Note the unexpected value of
tail
...