dthree / vorpal

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

Inconsistencies when reading 0 as argument #7

Closed AljoschaMeyer closed 9 years ago

AljoschaMeyer commented 9 years ago

The following code outputs 0 for the input t -index 0, but outputs undefined for the input t -i 0.

var Vorpal = require('./../../lib/vorpal');

var vorpal = new Vorpal();

vorpal.command('t')
.option("-i, --index <index>")
.action(function (args, cb) {
  console.log(args.options.index);
  cb()
});

vorpal.delimiter('foo:').show();
dthree commented 9 years ago

Fixed.