Skip to content
Myr

Merge pull request #216 from abbr/abbr_bugfix

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Add support for double dash option terminator

authored by Thomas Geraghty · committed by Thomas Geraghty · parents 4e839c2, fa3aa3f · Browse files · 2 files+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−2 removed

  • tests:+2 added−1 removed
  • other:+5 added−1 removed

2 files+7 added−2 removed

modified:test/test.options.hyphen.js+2 added-1 removed
modified:index.js+5 added-1 removed
445 unmodified lines
446 if (i > 0) {447 lastOpt = this.optionFor(args[i-1]);448 }449450 if(arg==='--'){451 // honor option terminator452 ret = ret.concat(args.slice(i));453 break;450 if (lastOpt && lastOpt.required) {454 } else if (lastOpt && lastOpt.required) {455 ret.push(arg);456 } else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {457 arg.slice(1).split('').forEach(function(c){458 ret.push('-' + c);
427 unmodified lines