Below is the out I get from the code that is also below.
Question
input
and i
are both true, as expected, but why isn't project
and p
?
They are defined that exact same way as input
and i
.
$ bin/test --input -p
{ _: [],
update: false,
u: false,
input: true,
i: true,
p: '',
project: '' }
And the code is
'use strict'
var minimist = require('minimist')
module.exports = () => {
var argv = minimist(process.argv.slice(2), {
string: 'input',
string: 'project',
boolean: ['help'],
boolean: ['update'],
alias: { i: 'input', h: 'help', p: 'project', u: 'update' },
unknown: function () { console.log('Unkown argument') }
})
if (argv.input || argv.i) {
console.log(argv)
}
if (argv.project || argv.p) {
console.log(argv)
console.log('p')
}