Skip to content
Myr

Use weaker wording: "broken" instead of "illegal"

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

authored by Wee Bit · committed by Abe Tomoaki · parent 1453bdf · Browse files · 2 files+4 added−4 removed
This commit

State

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

Diff stats

2 files+4 added−4 removed

  • tests:+1 added−1 removed
  • other:+3 added−3 removed

2 files+4 added−4 removed

modified:lib/command.js+3 added-3 removed
270 unmodified lines
271 if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation272273 this.commands.push(cmd);274 cmd.parent = this;275 this._checkForIllegalPassThroughOptions(cmd, this);275 this._checkForBrokenPassThrough(cmd, this);276277 return this;278 }279
456 unmodified lines
736 * for unknown options.737 */738 passThroughOptions(passThrough = true) {739 this._passThroughOptions = !!passThrough;740 this._checkForIllegalPassThroughOptions(this, this.parent);740 this._checkForBrokenPassThrough(this, this.parent);741 return this;742 }743744 /**
1 unmodified line
746 * @param {Command | null} parent747 * @api private748 */749750 _checkForIllegalPassThroughOptions(command, parent) {750 _checkForBrokenPassThrough(command, parent) {751 if (parent && command._passThroughOptions && !parent._enablePositionalOptions) {752 throw new Error(`passThroughOptions cannot be used for '${command._name}' without turning on enablePositionalOptions for parent command${parent._name ? ` '${parent._name}'` : ''}`);753 }754 }
1454 unmodified lines
modified:tests/command.positionalOptions.test.js+1 added-1 removed
360 unmodified lines
361});362363// ------------------------------------------------------------------------------364365describe('illegal passThroughOptions', () => {365describe('broken passThrough', () => {366 test('when program not positional and turn on passThroughOptions in subcommand then error', () => {367 const program = new commander.Command();368 const sub = program.command('sub');369
158 unmodified lines