Closed vanrez-nez closed 7 years ago
I guess variadic arguments can be used only as the last argument
@radixzz
Omidfi is correct, variadics must be last: https://github.com/dthree/vorpal/blob/master/lib/vorpal.js#L311 and https://github.com/dthree/vorpal/wiki/API-%7C-vorpal.command#multiple-arguments
They work in a similar vein to rest arguments: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters
Hi everyone!
Not sure if the following behavior is by design but:
with the input
cmd 1 2
will parse the args inside action without the 1:Is this a bug? or am I misusing the variadic and optional arguments?. Thank you!