Write out the command-specific help
@param  {String}       the single character of the command that this option is related to
557704
public static function writeHelpCommand($command = "") {
		
		/*
		
		The command help follows this format:
		
		Build Command Options
		
		Usage:
		  php core/console --build [--patternsonly|-p] [--nocache|-n] [--enablecss|-c]
		
		Available options:
		  --patternsonly (-p)    Build only the patterns. Does NOT clean public/.
		  --nocache      (-n)    Set the cacheBuster value to 0.
		  --enablecss    (-c)    Generate CSS for each pattern. Resource intensive.
		  --help         (-h)    Display this help message.
		
		Help:
		 The build command builds an entire site a single time. It compiles the patterns and moves content from source/ into public/
		
		 Samples:
		
		   To run and generate the CSS for each pattern:
		     php core/console --build -c
		
		   To build only the patterns and not move other files from source/ to public/
		     php core/console --build -p
		
		   To turn off the cacheBuster
		     php core/console --build -n
		*/
		
		// if given an empty command or the command doesn't exist in the lists give the generic help
		if (empty($command)) {
			self::writeHelp();
			return;
		}
		
		$commandLong       = self::$commands[$command]["commandLong"];
		$commandLongUC     = ucfirst($commandLong);
		$commandHelp       = self::$commands[$command]["commandHelp"];
		$commandExtra      = isset(self::$commands[$command]["commandExtra"]) ? self::$commands[$command]["commandExtra"] : "";
		$commandOptions    = self::$commands[$command]["commandOptions"];
		$commandExamples   = self::$commands[$command]["commandExamples"];
		$commandShort      = self::$commands[$command]["commandShort"];
		$commandShortInc   = ($commandShort != "") ? "|-".$commandShort : "";
		
		// write out the option list and get the longest item
		$optionList = "";
		$lengthLong = 0;
		foreach ($commandOptions as $option => $attributes) {
			$optionShort = (!empty($attributes["optionShort"][0]) && (($attributes["optionShort"][0] != "z") || ($attributes["optionShort"] != ""))) ? "|-".$attributes["optionShort"] : "";
			$optionExtra = (!empty($attributes["optionExtra"])) ? " ".$attributes["optionExtra"] : "";
			$optionList .= "[--".$attributes["optionLong"].$optionShort.$optionExtra."] ";
			$lengthLong = ($attributes["optionLongLength"] > $lengthLong) ? $attributes["optionLongLength"] : $lengthLong;
		}
		
		$commandExampleList = "";
		if (count($commandExamples) > 0) {
			foreach ($commandExamples as $example => $attributes) {
				$commandExampleList .= $attributes["exampleExtra"]." ";
			}
		}
		
		// write out the generic usage info
		self::writeLine("");
		self::writeLine("<h1>".$commandLongUC." Command Options</h1>",true,true);
		self::writeLine("<h2>Usage</h2>:",true,true);
		self::writeLine("  php ".self::$self." --".$commandLong.$commandShortInc." ".$optionList,true,true);
		
		// write out the available options
		if (count($commandOptions) > 0) {
			self::writeLine("<h2>Available options</h2>:",true,true);
			foreach ($commandOptions as $option => $attributes) {
				$optionShort = (!empty($attributes["optionShort"]) && (($attributes["optionShort"][0] != "z") || ($attributes["optionShort"] != ""))) ? "(-".$attributes["optionShort"].")" : "    ";
				$spacer = self::getSpacer($lengthLong,$attributes["optionLongLength"]);
				self::writeLine("  --".$attributes["optionLong"].$spacer.$optionShort."    <desc>".$attributes["optionDesc"]."</desc>",true);
			}
			self::writeLine("");
		}
		
		self::writeLine("<h2>Help</h2>:",true,true);
		self::writeLine("  ".$commandHelp,true,true);
		
		// write out the samples
		if ((count($commandOptions) > 0) || (count($commandExamples) > 0)) {
			self::writeLine("<h2>Samples</h2>:",true,true);
		}
		
		if (count($commandExamples) > 0) {
			foreach ($commandExamples as $example => $attributes) {
				self::writeLine(" ".$attributes["exampleSample"],true,true);
				self::writeLine("   <desc>php ".self::$self." --".$commandLong." ".$attributes["exampleExtra"]."</desc>",true,true);
			}
		}
		
		if (count($commandOptions) > 0) {
			foreach ($commandOptions as $option => $attributes) {
				self::writeLine(" ".$attributes["optionSample"],true,true);
				self::writeLine("   <desc>php ".self::$self." --".$commandLong." --".$attributes["optionLong"]." ".$attributes["optionExtra"]."</desc>",true,true);
			}
		}
		
	}
951059
def print_help(self, file=None):
        
        output = file or self.stderr
        CustomStderrOptionParser.print_help(self, output)
        output.write("\nCommands:\n")
        for command_def in self.command_definitions.values():
            command_def.opt_parser.print_help(output)
            output.write("\n")
677378
def help_for_command(command):
    """"""
    help_text = pydoc.text.document(command)
    # remove backspaces
    return re.subn('.\\x08', '', help_text)[0]
1147749
function (cmd, callback) {
    debug('called a custom command handler');
    console.log('Is your use case not solvable without a custom command handling? Sagas? Micro-Services?');

    var self = this;

    function _handle (aggId) {
      var concatenatedId = self.getConcatenatedId(aggId, cmd);

      var isFirst = !self.getNextCommandInQueue(concatenatedId);

      self.queueCommand(concatenatedId, cmd, callback);

      if (!isFirst) {
        return;
      }

      (function handleNext (aggregateId, c) {
        var concId = self.getConcatenatedId(aggregateId, c);
        var cmdEntry = self.getNextCommandInQueue(concId);
        if (cmdEntry) {
          if (cmdEntry.callback.length > 2) {
            self.cmdHndlFn(aggregateId, cmdEntry.command, self, function (err, evts, aggData, meta) {
              self.removeCommandFromQueue(concId, cmdEntry.command);
              handleNext(aggregateId, cmdEntry.command);
              cmdEntry.callback(err, evts, aggData, meta);
            });
            return;
          }
          self.cmdHndlFn(aggregateId, cmdEntry.command, self, function (err, evts) {
            self.removeCommandFromQueue(concId, cmdEntry.command);
            handleNext(aggregateId, cmdEntry.command);
            cmdEntry.callback(err, evts);
          });
        }
      })(aggId, cmd);
    }

    if (dotty.exists(cmd, this.definitions.command.aggregateId)) {
      return _handle(dotty.get(cmd, this.definitions.command.aggregateId));
    }

    debug('no aggregateId in command, so generate a new one');

    this.getNewAggregateId(cmd, function (err, id) {
      if (err) {
        debug(err);
        return callback(err);
      }

      return _handle(id);
    });
  }
109950
function(input) {
  if (!input)
    return show_help();

  switch (input[0]) {

    case 'help':
      show_help(input[1])
      break;

    case 'command':
      agent.commands.perform(input[1]);
      break;

    default:
      say('Unknown command: ' + input[0]);
  }
}
1356004
function addCommandOnCmdEditor (config) {

	var cmd_name = null;

	var promise = inquirer.prompt([{
		type: 'input',
		name: 'cmdName',
		message: 'What is name of a command (e.g. setMotorPower) ?',
		validate: function (value) {
			if (value.length == 0) return true;
			if (config.commands[value] != null) return 'This command name has already existed.';
			if (!value.match(/^[A-Za-z0-9_]+$/)) return 'Available characters for argument name: A-Z, a-z, 0-9, underscore.\n\
Or, if you want to cancel, please press the enter key left empty.';
			return true;
		}

	}]).then(function (answer) {

		cmd_name = answer.cmdName || null;
		if (cmd_name == null || cmd_name.length == 0) {
			return null;
		}

		return inquirer.prompt([{
			type: 'input',
			name: 'cmdDesc',
			message: 'What is description of ' + cmd_name + ' command ?'
		}]);


	}).then(function (answer) {

		if (cmd_name == null) return false;

		var commands = config.commands || {};
		commands[cmd_name] = {
			description: answer.cmdDesc || null,
			args: {}
		};

		// Done
		console.log(colors.bold.green('This command has been created: ' + cmd_name));

		// Save to the commands file
		console.log('\nWriting to ' + process.cwd() + '/' + COMMANDS_FILENAME);
		fs.writeFileSync(COMMANDS_FILENAME, JSON.stringify(config.commands));
		console.log('Writing has been completed.\n\n');
		return true;

	});

	return promise;

}
985340
def write(s = ''):
    

    for char in s:
        if char.isupper():  # Handles uppercase
            hold('shift', char.lower())
        elif char == " ":  # Handles spaces
            press('spacebar')
        elif char == "\n":  # Handles newline
            press('enter')
        elif char in (')', '!', '@', '#', '$', '%', '^', '&', '*', '('):  # Handles shift & number
            hold('shift', str((')', '!', '@', '#', '$', '%', '^', '&', '*', '(').index(char)))
        elif char in ('{', '}', '<', '>', '?', ':', '"', '_', '+', '~'):
            hold('shift', ('[', ']', ',', '.', '/', ';', "'", '-', '=', '`')[('{', '}', '<', '>', '?', ':', '"', '_',
                                                                              '+', '~').index(char)])
        else:
            press(char)
37601
def help(self, event, command_name=None):
        
        if command_name is None:
            return ("Type !commands for a list of all commands. Type "
                    "!help [command] to see help for a specific command.")
        try:
            command = self.commands_dict()[command_name]
        except KeyError:
            return "%s is not a command" % command_name

        argspec = getargspec(command)
        args = argspec.args[2:]
        defaults = argspec.defaults or []
        for i in range(-1, -len(defaults) - 1, -1):
            args[i] = "%s [default: %s]" % (args[i], defaults[i])
        args = ", ".join(args)
        help = getdoc(command).replace("\n", " ")
        return "help for %s: (args: %s) %s" % (command_name, args, help)
36835
function(c){
        var args = [];
        /* command acceptance */
        args.push((c.cmd.short ? c.cmd.short+', ' : '')+c.cmd.long + ' [value]');
        /* command help message */
        args.push((c.cmd.help ? c.cmd.help : c.prompt.message));
        return args;
      }
994642
def show_help(self):
        
        output = [
            'Usage %s subcommand [options] [args]' % self.prog_name,
            '',
            'Available commands:',
            '',
        ]
        for cmd in self.get_commands():
            output.append('  %s' % cmd)
        output += ['', '']
        self.stdout.write(u'\n'.join(output))
1072608
public void help(String command) {

        if ("*".equalsIgnoreCase(command)) {
            m_shell.help(null);
        } else if ("help".equalsIgnoreCase(command)) {
            help();
        } else {
            m_shell.help(command);
        }
    }
1310768
function commandExamples(examples) {
  if (!examples || !examples.length) {
    return ''
  }
  let exampleRender = `**Examples**${newLine}`
  exampleRender += '\`\`\`bash\n'
  examples.forEach((ex) => {
    console.log('ex', ex)
    exampleRender += `${ex}\n`
  })
  exampleRender += `\`\`\`${newLine}`
  return exampleRender
}
1065725
function(state, command, error)
  {
    console.log('> Failed to execute ``', command, '``' + withCmdPrefix(state) + ':');
    console.log('```');
    console.log(JSON.stringify(error, null, 2));
    console.log('```');
  }
943439
def help(self, command=None):
        
        cmd = 'help'
        if command: cmd += ' %s' % command
        return self.fetch(cmd)[1]
1257570
def help_text(self):
        
        help_text = '\n'.join(sorted(get_commands().keys()))
        help_text = "\nCommands:\n" + help_text
        return help_text
1289267
function outputHelp() {
    console.log(
        '\nUsage: git-hooks [options]\n\n' +
        'A tool to manage project Git hooks\n\n' +
        'Options:\n\n' +
        Object.keys(options)
            .map(function (key) {
                return '  --' + key + '\t' + options[key] + '\n';
            })
            .join('')
    );
}
1136111
function commands(req, res /*, next */) {
  req.app.commands.forEach(function(command) {
    res.writeln(command);
  });
  res.end();
}