Lines Matching refs:cmd

169     const cmd = this.createCommand(args.shift());
172 cmd.description(desc);
173 cmd._executableHandler = true;
175 if (opts.isDefault) this._defaultCommandName = cmd._name;
177 cmd._hidden = !!(opts.noHelp || opts.hidden);
178 cmd._helpFlags = this._helpFlags;
179 cmd._helpDescription = this._helpDescription;
180 cmd._helpShortFlag = this._helpShortFlag;
181 cmd._helpLongFlag = this._helpLongFlag;
182 cmd._helpCommandName = this._helpCommandName;
183 cmd._helpCommandnameAndArgs = this._helpCommandnameAndArgs;
184 cmd._helpCommandDescription = this._helpCommandDescription;
185 cmd._exitCallback = this._exitCallback;
186 cmd._storeOptionsAsProperties = this._storeOptionsAsProperties;
187 cmd._passCommandToAction = this._passCommandToAction;
189cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing…
190 this.commands.push(cmd);
191 cmd._parseExpectedArgs(args);
192 cmd.parent = this;
195 return cmd;
224 addCommand(cmd, opts) { argument
225 if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name');
230 commandArray.forEach((cmd) => {
231 if (cmd._executableHandler && !cmd._executableFile) {
232 … throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`);
234 checkExplicitNames(cmd.commands);
237 checkExplicitNames(cmd.commands);
240 if (opts.isDefault) this._defaultCommandName = cmd._name;
241 …if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing im…
243 this.commands.push(cmd);
244 cmd.parent = this;
940 return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));
964 for (let cmd = this; cmd; cmd = cmd.parent) {
965 cmd.options.forEach((anOption) => {
966 if (anOption.mandatory && (cmd._getOptionValue(anOption.attributeName()) === undefined)) {
967 cmd.missingMandatoryOptionValue(anOption);
1304 const commandDetails = this.commands.filter((cmd) => {
1305 return !cmd._hidden;
1306 }).map((cmd) => {
1307 const args = cmd._args.map((arg) => {
1312 cmd._name +
1313 (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
1314 (cmd.options.length ? ' [options]' : '') +
1316 cmd._description
1451 commands.map((cmd) => {
1452 const desc = cmd[1] ? ' ' + cmd[1] : '';
1453 … return (desc ? pad(cmd[0], width) : cmd[0]) + optionalWrap(desc, descriptionWidth, width + 2);
1686 function outputHelpIfRequested(cmd, args) { argument
1687 const helpOption = args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);
1689 cmd.outputHelp();
1691 cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');