Skip to content
Myr

Merge pull request #308 from zhiyelee/fixvariadic

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

fix #302

authored by Zhiye Li · committed by Zhiye Li · parents 1444cf3, 3cddb23 · Browse files · 2 files+2 added−4 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+2 added−4 removed

  • tests:+1 added−1 removed
  • other:+1 added−3 removed

2 files+2 added−4 removed

modified:test/test.variadic.args.js+1 added-1 removed
modified:index.js+1 added-3 removed
159 unmodified lines
160 if (desc) {161 cmd.description(desc);162 this.executables = true;163 this._execs[cmd._name] = true;164164 }165166 this.commands.push(cmd);167 cmd.parseExpectedArgs(args);
43 unmodified lines
211 argDetails.name = arg.slice(1, -1);212 break;213 }214216 if (argDetails.name.indexOf('...') === argDetails.name.length - 3) {215 if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {216 argDetails.variadic = true;217 argDetails.name = argDetails.name.slice(0, -3);218 }220219 if (argDetails.name) {220 self._args.push(argDetails);221 }222 });
763 unmodified lines