Skip to content
Myr

refactor

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

authored by zhiyelee · committed by zhiyelee · parent 204e3ac · Browse files · 1 file+5 added−5 removed
This commit

State

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

Diff stats

1 file+5 added−5 removed

  • other:+5 added−5 removed

1 file+5 added−5 removed

modified:index.js+5 added-5 removed
80 unmodified lines
81function Command(name) {82 this.commands = [];83 this.options = [];84 this._execs = [];85 this._allow_unknown = false;85 this._allowUnknown = false;86 this._args = [];87 this._name = name;88}89
304 unmodified lines
394395/**396 * Allow unknown options on the command line.397 *398 * @param {Boolean} allow398 * @param {Boolean} arg399 * @api public400 */401Command.prototype.allowUnknown = function(allow) {402 this._allow_unknown = allow === undefined ? false : allow;401Command.prototype.allowUnknown = function(arg) {402 this._allowUnknown = !!arg;403 return this;404}405406/**
140 unmodified lines
547 outputHelpIfNecessary(this, unknown);548549 // If there were no args and we have unknown options,550 // then they are extraneous and we need to error.551 if (!this._allow_unknown && unknown.length > 0) {551 if (!this._allowUnknown && unknown.length > 0) {552 this.unknownOption(unknown[0]);553 }554 }555
444 unmodified lines