Skip to content
Myr

subcommand allowUnknown option

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

authored by zhiyelee · committed by zhiyelee · parent 2c013fa · Browse files · 1 file+2 added−1 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+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:index.js+2 added-1 removed
545 unmodified lines
546 outputHelpIfNecessary(this, unknown);547548 // If there were no args and we have unknown options,549 // then they are extraneous and we need to error.550 if (!this._allowUnknown && unknown.length > 0) {550 if (unknown.length > 0) {551 this.unknownOption(unknown[0]);552 }553 }554
152 unmodified lines
707 * @api private708 */709710Command.prototype.unknownOption = function(flag) {711 if(this._allowUnknown) return;712 console.error();713 console.error(" error: unknown option `%s'", flag);714 console.error();715 process.exit(1);
284 unmodified lines