commander 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +6 -1
- package/index.js +4 -4
- package/package.json +1 -1
package/History.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
2.7.
|
|
2
|
+
2.7.1 / 2015-03-11
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
* Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
|
|
6
|
+
|
|
7
|
+
2.7.0 / 2015-03-09
|
|
3
8
|
==================
|
|
4
9
|
|
|
5
10
|
* Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
|
package/index.js
CHANGED
|
@@ -288,8 +288,8 @@ Command.prototype.action = function(fn) {
|
|
|
288
288
|
|
|
289
289
|
fn.apply(self, args);
|
|
290
290
|
};
|
|
291
|
-
this.parent.on(
|
|
292
|
-
if (this._alias) this.parent.on(
|
|
291
|
+
this.parent.on(this._name, listener);
|
|
292
|
+
if (this._alias) this.parent.on(this._alias, listener);
|
|
293
293
|
return this;
|
|
294
294
|
};
|
|
295
295
|
|
|
@@ -568,8 +568,8 @@ Command.prototype.parseArgs = function(args, unknown) {
|
|
|
568
568
|
|
|
569
569
|
if (args.length) {
|
|
570
570
|
name = args[0];
|
|
571
|
-
if (this.listeners(
|
|
572
|
-
this.emit(
|
|
571
|
+
if (this.listeners(name).length) {
|
|
572
|
+
this.emit(args.shift(), args, unknown);
|
|
573
573
|
} else {
|
|
574
574
|
this.emit('*', args);
|
|
575
575
|
}
|