Skip to content
Myr

Revert "Issue #346, fix collisions when option and first arg have same name"

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

authored by Zhiye Li · committed by Zhiye Li · parent 481e943 · Browse files · 2 files+4 added−18 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+4 added−18 removed

  • tests:+0 added−14 removed
  • other:+4 added−4 removed

2 files+4 added−18 removed

deleted:test/test.options.same-name-arg.js-14 removed
modified:index.js+4 added-4 removed
286 unmodified lines
287 }288289 fn.apply(self, args);290 };291 this.parent.on('action_' + this._name, listener);292 if (this._alias) this.parent.on('action_' + this._alias, listener);291 this.parent.on(this._name, listener);292 if (this._alias) this.parent.on(this._alias, listener);293 return this;294};295296/**
270 unmodified lines
567 var name;568569 if (args.length) {570 name = args[0];571 if (this.listeners('action_' + name).length) {572 this.emit('action_' + args.shift(), args, unknown);571 if (this.listeners(name).length) {572 this.emit(args.shift(), args, unknown);573 } else {574 this.emit('*', args);575 }576 } else {
475 unmodified lines