This PR allows specifying positional arguments names in .command.types(object). This is what the example from the wiki would look like once this is merged:
vorpal
.command('stringify <phone>')
.option('-a, --amount <amt>', 'A number to stringify.')
.types({
string: ['a', 'amount', 'phone']
})
.action(function (args, cb) {
this.log(args.options);
cb();
});
app~$ stringify 4238892 -a 7
{amount: '7', phone: '4238892'}
# Fields "amount" and "phone" would have otherwise been integers
This works with both optional, required and variadic arguments.
This PR allows specifying positional arguments names in
.command.types(object)
. This is what the example from the wiki would look like once this is merged:This works with both optional, required and variadic arguments.
NOTE: this PR required https://github.com/substack/minimist/pull/113 to be merged first