Lines Matching full:command
25 …e option must have a value after parsing, which usually means it must be specified on command line.
93 class Command extends EventEmitter { class
95 * Initialize a new `Command`.
124 this._helpDescription = 'display help for command';
129 this._helpCommandnameAndArgs = 'help [command]';
130 this._helpCommandDescription = 'display help for command';
134 * Define a command.
136 * There are two styles of command: pay attention to where to put the description.
140 …* // Command implemented using action handler (description is supplied separately to `.comman…
142 * .command('clone <source> [destination]')
145 * console.log('clone command called');
148 …* // Command implemented using separate executable file (description is second parameter to `…
150 * .command('start <service>', 'start named service')
151 * .command('stop [service]', 'stop named service, or all if no name supplied');
153 …* @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` …
156 * @return {Command} returns new command for action handler, or `this` for executable command
160 command(nameAndArgs, actionOptsOrExecDesc, execOpts) { method in Command
199 * Factory routine to create a new unattached command.
201 * See .command() for creating an attached subcommand, which uses this routine to
202 * create the command. You can override createCommand to customise subcommands.
205 * @return {Command} new command
210 return new Command(name);
216 * See .command() for creating an attached subcommand which inherits settings from its parent.
218 * @param {Command} cmd - new subcommand
220 * @return {Command} `this` command for chaining
225 if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name');
241 …if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing im…
249 * Define argument syntax for the command.
259 * Override default decision whether to add implicit help command.
265 * @return {Command} `this` command for chaining
301 * @return {Command} `this` command for chaining
344 * @return {Command} `this` command for chaining
382 * Register callback `fn` for the command.
387 * .command('help')
394 * @return {Command} `this` command for chaining
400 // The .action callback takes an extra parameter which is the command or options.
433 * @return {Command} `this` command for chaining
551 * @return {Command} `this` command for chaining
561 * the option must be specified on the command line. (Otherwise the same as .option().)
569 * @return {Command} `this` command for chaining
578 * Allow unknown options on the command line.
590 * Whether to store option values as properties on command object,
594 * @return {Command} `this` command for chaining
607 * Whether to pass command to action handler,
611 * @return {Command} `this` command for chaining
666 * @return {Command} `this` command for chaining
749 * Execute a sub-command executable.
759 …ikely to have mandatory and executable, and can't robustly test for help flags in external command.
762 …// Want the entry script as the reference for command name and directory for searching for other f…
835 …bcommand._name}' is not meant to be an executable command, remove description parameter from '.com…
870 * Process arguments in context of this command.
890 …ed(this, unknown); // Run the help for default command from parent rather than passing to default …
915 this.emit('command:' + this.name(), operands, unknown);
919 } else if (this.listenerCount('command:*')) {
920 this.emit('command:*', operands, unknown);
925 // This command has subcommands and nothing hooked up at this level, so display help.
934 * Find matching command.
1153 * Unknown command.
1164 …const message = `error: unknown command '${this.args[0]}'. See '${fullCommand} ${this._helpLongFla…
1180 * @return {this | string} `this` command for chaining, or version string if no arguments
1204 * @return {string|Command}
1216 * Set an alias for the command.
1221 * @return {string|Command}
1228 let command = this;
1231 command = this.commands[this.commands.length - 1];
1234 if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
1236 command._aliases.push(alias);
1241 * Set aliases for the command.
1246 * @return {string[]|Command}
1259 * Set / get the command usage `str`.
1262 * @return {String|Command}
1274 (this.commands.length ? ' [command]' : '') +
1283 * Get or set the name of the command
1286 * @return {String|Command}
1327 * Return the largest command length.
1335 return commands.reduce((max, command) => {
1336 return Math.max(max, command[0].length);
1434 * Return command help documentation.
1519 * Output help information for this command.
1543 * flags and help description for your command.
1547 * @return {Command} `this` command for chaining
1593 * Expose the root command.
1596 exports = module.exports = new Command();
1597 exports.program = exports; // More explicit access to global command.
1603 exports.Command = Command;
1681 * @param {Command} cmd - command to output help for
1712 …guments and increment port number for inspect calls (to avoid conflicts when spawning new command).