Skip to content

Commit

Permalink
Alleviate weird issue with duplicate handling
Browse files Browse the repository at this point in the history
This is still a bug, albeit one less glaring than before. This module is
in dire need of a full rewrite...
  • Loading branch information
Alhadis committed Feb 27, 2019
1 parent 2ecab5e commit 394c7a0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,18 +524,17 @@ function getOpts(input, optdef = null, config = {}){
else{
const {names} = option;

// Ascertain if this option's being duplicated
if(result.options[ names[0] ])
value = resolveDuplicate(option, value);


option.names.forEach(name => {
for(let name of names){

// Decide whether to camelCase this option name
name = formatName(name, noCamelCase);

// Ascertain if this option's being duplicated
if(result.options[name])
resolveDuplicate(option, name, value);

result.options[name] = value;
});
}
}
}

Expand Down

0 comments on commit 394c7a0

Please sign in to comment.