Returns the command and description of all supplied commands as a formatted String
@param botCommands the Commands that should be included in the String
@return a formatted String containing command and description for all supplied commands
355558
public static String getHelpText(IBotCommand...botCommands) {
		StringBuilder reply = new StringBuilder();
		for (IBotCommand com : botCommands) {
			reply.append(com.toString()).append(System.lineSeparator()).append(System.lineSeparator());
		}
		return reply.toString();
	}
422452
public static StringBuffer runCommand(String[] cmd) {
    StringBuffer retval = new StringBuffer(MAX_OUTPUT_LENGTH);
    Process p;
    try {
      p = Runtime.getRuntime().exec(cmd);
      InputStream tmp = p.getInputStream();
      p.waitFor();
      int c;
      while ((c = tmp.read()) != -1)
        retval.append((char) c);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    return retval;
  }
1285962
public Collection<String> getCommands() {
        List<String> commands = new ArrayList<String>();
        for (String cmdOwner : m_cmdsByOwnerMap.keySet()) {
            SortedMap<String, RESTCommand> ownerCmdMap = m_cmdsByOwnerMap.get(cmdOwner);
            for (String name : ownerCmdMap.keySet()) {
                RESTCommand cmd = ownerCmdMap.get(name);
                commands.add(String.format("%s: %s = %s", cmdOwner, name, cmd.toString()));
            }
        }
        return commands;
    }
91683
@Override
    public String sendCommandStr(String command) {
        String str = null;
        try {
            str = sendCommand2(command);
        } catch (Exception ex) {
            logger.error("Could not run command " + command, ex);
        }
        return str;
    }
1219239
public static String command(final Command command, CommandListener listener) throws Exception {
        command.mListener = listener;
        return command(command);
    }
925717
public java.util.List<Command> getCommands() {
        if (commands == null) {
            commands = new com.amazonaws.internal.SdkInternalList<Command>();
        }
        return commands;
    }
787414
def parse_command(bot: NoneBot,
                  cmd_string: str) -> Tuple[Optional[Command], Optional[str]]:
    
    logger.debug(f'Parsing command: {cmd_string}')

    matched_start = None
    for start in bot.config.COMMAND_START:
        # loop through COMMAND_START to find the longest matched start
        curr_matched_start = None
        if isinstance(start, type(re.compile(''))):
            m = start.search(cmd_string)
            if m and m.start(0) == 0:
                curr_matched_start = m.group(0)
        elif isinstance(start, str):
            if cmd_string.startswith(start):
                curr_matched_start = start

        if curr_matched_start is not None and \
                (matched_start is None or
                 len(curr_matched_start) > len(matched_start)):
            # a longer start, use it
            matched_start = curr_matched_start

    if matched_start is None:
        # it's not a command
        logger.debug('It\'s not a command')
        return None, None

    logger.debug(f'Matched command start: '
                 f'{matched_start}{"(empty)" if not matched_start else ""}')
    full_command = cmd_string[len(matched_start):].lstrip()

    if not full_command:
        # command is empty
        return None, None

    cmd_name_text, *cmd_remained = full_command.split(maxsplit=1)
    cmd_name = _aliases.get(cmd_name_text)

    if not cmd_name:
        for sep in bot.config.COMMAND_SEP:
            # loop through COMMAND_SEP to find the most optimized split
            curr_cmd_name = None
            if isinstance(sep, type(re.compile(''))):
                curr_cmd_name = tuple(sep.split(cmd_name_text))
            elif isinstance(sep, str):
                curr_cmd_name = tuple(cmd_name_text.split(sep))

            if curr_cmd_name is not None and \
                    (not cmd_name or len(curr_cmd_name) > len(cmd_name)):
                # a more optimized split, use it
                cmd_name = curr_cmd_name

        if not cmd_name:
            cmd_name = (cmd_name_text,)

    logger.debug(f'Split command name: {cmd_name}')
    cmd = _find_command(cmd_name)
    if not cmd:
        logger.debug(f'Command {cmd_name} not found')
        return None, None

    logger.debug(f'Command {cmd.name} found, function: {cmd.func}')
    return cmd, ''.join(cmd_remained)
52327
String doHandleCommand(final String command) {
        app.handleCommand(command);
        final String output = buffer.toString();
        buffer.setLength(0);
        return output;
    }
236180
public List<AbstractCommand> getCommands()
    {
        return commands.values().stream()
                        .map(id -> AbstractCommand.search(id))
                        .collect(Collectors.toList());
    }
359250
private String executeCommand(String command) {
        System.out.println("Execute: " + command);

        StringBuilder output = new StringBuilder();
        Process       p;
        try {
            p = Runtime.getRuntime().exec(command);
            p.waitFor();
            BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String         line;
            while ((line = reader.readLine()) != null) {
                output.append(line).append("\n");
            }
        } catch (Exception e) {
            throw new WebpIOException(e);
        }
        if (!"".equals(output.toString())) {
            System.out.println("Output: " + output);
        }
        return "";
    }
936842
public static List<String> execForLines(String... cmds) throws IORuntimeException {
		return execForLines(CharsetUtil.systemCharset(), cmds);
	}
530631
public String[] getCommandLine() {
        String[] argsAry = argsString != null ? split(argsString) : EMPTY_ARRAY;
        List<String> argsList = new ArrayList<String>();

        int startIndex = 0;

        for (CommandOption opt : optionsList) {
            String argName = opt.getName();
            String argValueString = opt.getValue();

            argsList.add((argName.length() == 1 ? "-" : "--") + argName);

            if (argValueString != null) {
                argsList.add(quote(argValueString));
            }
        }

        String[] resAry = new String[argsAry.length + argsList.size()];

        for (String argString : argsList) {
            resAry[startIndex++] = argString;
        }

        // vsRes = new String[args.length + m_vArguments.size()];
        System.arraycopy(argsAry, 0, resAry, startIndex, argsAry.length);

        return resAry;
    }
334758
private <T extends CommandResultType> T getCommandResult() {
        if (commandResult == null) {
            if (getPayload() instanceof String) {
                this.commandResult = (T) marshaller.unmarshal(new StringSource(getPayload(String.class)));
            }
        }

        return (T) commandResult;
    }
627969
private static String showCommandAliases() {
        final Command[] commands = Command.values();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < commands.length; ++i) {
            if (i != 0) {
                sb.append(", ");
                if (i == commands.length - 1) {
                    sb.append("or ");
                }
            }
            sb.append("`--");
            sb.append(commands[i].getAlias());
            sb.append("`");
        }
        return sb.toString();
    }
762286
public List<ModelServiceInstance> queryService(List<StringCommand> commands){

        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.QueryService);

        List<QueryCommand> cs = new ArrayList<QueryCommand>();
        for(StringCommand c : commands){
            cs.add(c.getStringCommand());
        }

        QueryServiceProtocol p = new QueryServiceProtocol(cs);
        QueryServiceResponse resp ;
        resp = (QueryServiceResponse) connection.submitRequest(header, p,  null);
        return resp.getInstances();
    }
415196
def print_commands():
    
    dummy_log_file = Log()
    commands = Log.commands()
    commands.sort()

    for cmd in commands:
        cmd = getattr(dummy_log_file, 'cmd_{0}'.format(cmd))
        description = cmd.__doc__
        if description:
            description = re.sub(r'\n\s+', ' ', description)
            description = description.strip()

        print('{0}: {1}\n'.format(cmd.__name__, description))
523010
function getCommand(commandName) {
    return _.find(commands, function (command) {
      return _.includes(command.aliases, commandName);
    });
  }