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.
Files changed (3) hide show
  1. package/History.md +6 -1
  2. package/index.js +4 -4
  3. package/package.json +1 -1
package/History.md CHANGED
@@ -1,5 +1,10 @@
1
1
 
2
- 2.7.0 / 2015-03-07
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('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
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('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
573
  } else {
574
574
  this.emit('*', args);
575
575
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commander",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "the complete solution for node.js command-line programs",
5
5
  "keywords": [
6
6
  "command",