dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

variadic argument won't take 0 as first argument #218

Closed spencewine closed 7 years ago

spencewine commented 7 years ago

This appears to be a bug. If call the add command like this:

add 0 0 0 0 1

I would expect an args.bills to equal [0,0,0,0,1]. Instead, args.bills = 0.

here is the code I used

program
.command('add [bills...]')
.description('run addBills to register') .action(function(args, cb){ cashRegister = Object.assign({}, cashRegister, totalBills(args.bills, 'Added')) showReg() cb() });