-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Adding the option values to the command object will only cause conflicts between the properties of the command object and of the command options.
Let's take this example:
program.option('--parse', 'parse');
program.option('--parse2', 'parse');
program.parse(['node', 'test', '--parse', '--parse2']);
console.log(program.parse); // undefined
console.log(program.parse2); // trueThis seems like a pretty serious bug to me, certainly it's prevented me from naming my option 'parent' because of conflicts with this particular line: https://github.com/visionmedia/commander.js/blob/master/index.js#L155
Why can't the option values just be added to a new empty object?? Something like this;
program.option('--parse', 'parse');
program.option('--parse2', 'parse');
program.parse(['node', 'test', '--parse', '--parse2']);
console.log(program.input.parse); // true
console.log(program.input.parse2); // trueReactions are currently unavailable