Closed jcoglan closed 10 years ago
(Posting here on the advice of @cjno due to busterjs/posix-argv-parser not having issues open.)
This program:
var pap = require('posix-argv-parser'), parser = pap.create(); parser.createOption(['--config', '-c'], {hasValue: false}); parser.createOption(['--length', '-l'], {hasValue: true}); parser.createOperand('service'); parser.parse(['-cl', '10'], function(error, options) { console.error(error); console.log(options); });
Produces the following output:
{ '--config': { isSet: true, value: undefined, timesSet: 1, signature: '--config/-c' }, '-c': { isSet: true, value: undefined, timesSet: 1, signature: '--config/-c' }, '--length': { isSet: true, value: '', timesSet: 1, signature: '--length/-l' }, '-l': { isSet: true, value: '', timesSet: 1, signature: '--length/-l' }, service: { isSet: true, value: '10', timesSet: 1, signature: 'service' } }
Whereas it should set --length to '10' and leave service undefined.
--length
'10'
service
undefined
Fixed by bba3e4cc3f.
(Posting here on the advice of @cjno due to busterjs/posix-argv-parser not having issues open.)
This program:
Produces the following output:
Whereas it should set
--length
to'10'
and leaveservice
undefined
.