MCPcopy
hub / github.com/tj/commander.js / copyInheritedSettings

Method copyInheritedSettings

lib/command.js:100–115  ·  view source on GitHub ↗

* Copy settings that are useful to have in common across root command and subcommands. * * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.) * * @param {Command} sourceCommand * @return {Command} `this` command for chaining

(sourceCommand)

Source from the content-addressed store, hash-verified

98 * @return {Command} `this` command for chaining
99 */
100 copyInheritedSettings(sourceCommand) {
101 this._outputConfiguration = sourceCommand._outputConfiguration;
102 this._helpOption = sourceCommand._helpOption;
103 this._helpCommand = sourceCommand._helpCommand;
104 this._helpConfiguration = sourceCommand._helpConfiguration;
105 this._exitCallback = sourceCommand._exitCallback;
106 this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
107 this._combineFlagAndOptionalValue =
108 sourceCommand._combineFlagAndOptionalValue;
109 this._allowExcessArguments = sourceCommand._allowExcessArguments;
110 this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
111 this._showHelpAfterError = sourceCommand._showHelpAfterError;
112 this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
113
114 return this;
115 }
116
117 /**
118 * @returns {Command[]}

Callers 6

commandMethod · 0.80
getSuggestionFunction · 0.80
index.test-d.tsFile · 0.80

Calls

no outgoing calls

Tested by 1

getSuggestionFunction · 0.64