-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Bugthing that needs fixingthing that needs fixing
Description
I've noticed a behavior change from [email protected] -> [email protected] with the parsing of unexpected arguments.
- In [email protected] '-a a' and '-a=a' (as well as with
--) were equivalent. - In [email protected] '-a a' and '-a=a' (as well as with
--) behave differently. Basically,-a aworks like-a(setting propatotrue) but adds"a"the theremainarray. Shouldn't both set propato string"a"?
$ npm install nopt@~1.0.10
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/abbrev
[email protected] node_modules/nopt
└── [email protected]
$ node -pe "require('nopt')({}, {}, ['-a', 'a', '-b=b', '--c', 'c', '--d=d'], 0)"
{ a: 'a',
b: 'b',
c: 'c',
d: 'd',
argv:
{ remain: [],
cooked: [ '-a', 'a', '-b', 'b', '--c', 'c', '--d', 'd' ],
original: [ '-a', 'a', '-b=b', '--c', 'c', '--d=d' ],
toString: [Function] } }
$ npm install nopt@latest
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/abbrev
[email protected] node_modules/nopt
└── [email protected]
$ node -pe "require('nopt')({}, {}, ['-a', 'a', '-b=b', '--c', 'c', '--d=d'], 0)"
{ a: true,
b: 'b',
c: true,
d: 'd',
argv:
{ remain: [ 'a', 'c' ],
cooked: [ '-a', 'a', '-b', 'b', '--c', 'c', '--d', 'd' ],
original: [ '-a', 'a', '-b=b', '--c', 'c', '--d=d' ] } }Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixing