Skip to content
Myr

Merge branch 'master' into fix-global

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

authored by zhiyelee · committed by zhiyelee · parents 30ba68e, 54583a3 · Browse files · 6 files+68 added−6 removed
This commit

State

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

Diff stats

6 files+68 added−6 removed

  • tests:+59 added−1 removed
  • other:+9 added−5 removed

6 files+68 added−6 removed

added:test/test.options.bool.optional.given.js+21 added
added:test/test.options.bool.optional.js+21 added
modified:test/test.options.func.js+3 added-1 removed
added:test/test.options.same-name-arg.js+14 added
modified:index.js+7 added-5 removed
286 unmodified lines
287 }288289 fn.apply(self, args);290 };291 this.parent.on(this._name, listener);292 if (this._alias) this.parent.on(this._alias, listener);291 this.parent.on('action_' + this._name, listener);292 if (this._alias) this.parent.on('action_' + this._alias, listener);293 return this;294};295296/**
91 unmodified lines
388 if (null == val) {389 self[name] = option.bool390 ? defaultValue || true391 : false;392 } else if (option.flags.indexOf('<boolean>') > -1 || option.flags.indexOf('[boolean]') > -1) {393 self[name] = (val === 'true');394 } else {395 self[name] = val;396 }397 } else if (null !== val) {
171 unmodified lines
569 var name;570571 if (args.length) {572 name = args[0];571 if (this.listeners(name).length) {572 this.emit(args.shift(), args, unknown);573 if (this.listeners('action_' + name).length) {574 this.emit('action_' + args.shift(), args, unknown);575 } else {576 this.emit('*', args);577 }578 } else {
114 unmodified lines
693 var result = {}694 , len = this.options.length;695696 for (var i = 0 ; i < len; i++) {695 var key = this.options[i].name();697 var key = camelcase(this.options[i].name());698 result[key] = key === 'version' ? this._version : this[key];699 }700 return result;701};
352 unmodified lines
modified:Readme.md+2 added
1# Commander.js23[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)45 [![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js)6[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)7[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)8
321 unmodified lines