Print a command (it's name, description and parameters).

@param command Command to describe.
186149
public void printCommand(CliCommand command) {
        final PrintContext context = new PrintContext();

        // Print command name : description
        printIdentifiable(context, command);

        // Print each param name : description
        printIdentifiables(context, command.getParams());
    }
309372
static void write(Command cmd, OutputStream out) throws UnsupportedEncodingException, IOException {
        encode(cmd.getCommand(), out);
        for (Parameter param : cmd.getParameters()) {
            encode(String.format("=%s=%s", param.getName(), param.hasValue() ? param.getValue() : ""), out);
        }
        String tag = cmd.getTag();
        if ((tag != null) && !tag.equals("")) {
            encode(String.format(".tag=%s", tag), out);
        }
        List<String> props = cmd.getProperties();
        if (!props.isEmpty()) {
            StringBuilder buf = new StringBuilder("=.proplist=");
            for (int i = 0; i < props.size(); ++i) {
                if (i > 0) {
                    buf.append(",");
                }
                buf.append(props.get(i));
            }
            encode(buf.toString(), out);
        }
        for (String query : cmd.getQueries()) {
            encode(query, out);
        }
        out.write(0);
    }
231422
def command_info(self, command, *commands):
        """"""
        return self.execute(b'COMMAND', b'INFO', command, *commands,
                            encoding='utf-8')
1170219
protected static void main(String[] args, CliTool command) {
    JCommander jc = new JCommander(command);
    jc.addConverterFactory(new CustomParameterConverters());
    jc.setProgramName(command.getClass().getAnnotation(Parameters.class).commandNames()[0]);

    ExitStatus exitStatus = ExitStatus.SUCCESS;
    try {
      jc.parse(args);
      if (command.help) {
        helpDisplayCommandOptions(System.err, jc);
      } else {
        exitStatus = command.call();
      }
    } catch (ExitStatusException e) {
      System.err.println(e.getMessage());
      if (e.getCause() != null) {
        e.getCause().printStackTrace(System.err);
      }
      exitStatus = e.exitStatus;
    } catch (MissingCommandException e) {
      System.err.println("Invalid argument: " + e);
      System.err.println();
      helpDisplayCommandOptions(System.err, jc);
      exitStatus = ExitStatus.ERROR_INVALID_ARGUMENTS;
    } catch (ParameterException e) {
      System.err.println("Invalid argument: " + e.getMessage());
      System.err.println();

      if (jc.getParsedCommand() == null) {
        helpDisplayCommandOptions(System.err, jc);
      } else {
        helpDisplayCommandOptions(System.err, jc.getParsedCommand(), jc);
      }
      exitStatus = ExitStatus.ERROR_INVALID_ARGUMENTS;
    } catch (Throwable t) {
      System.err.println("An unhandled exception occurred. Stack trace below.");
      t.printStackTrace(System.err);
      exitStatus = ExitStatus.ERROR_OTHER;
    }

    if (command.callSystemExit) {
      System.exit(exitStatus.code);
    }
  }
244251
def command():
        
        return (
            OneOrMore(
                Word(approved_printables+' ').setResultsName('command',
                    listAllMatches=True) ^
                Grammar.__command_input_output.setResultsName('_in',
                    listAllMatches=True)
                )
            )
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();
    }
22570
private static String commandRun(Command command) {
        // Wait bind
        if (I_COMMAND == null) {
            synchronized (I_LOCK) {
                if (I_COMMAND == null) {
                    try {
                        I_LOCK.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }

        // Cancel Destroy Service
        cancelDestroyService();

        // Get result
        // In this we should try 5 count get the result
        int count = 5;
        Exception error = null;
        while (count > 0) {
            if (command.isCancel) {
                if (command.mListener != null)
                    command.mListener.onCancel();
                break;
            }
            try {
                command.mResult = I_COMMAND.command(command.mId, command.mTimeout, command.mParameters);
                if (command.mListener != null)
                    command.mListener.onCompleted(command.mResult);
                break;
            } catch (Exception e) {
                error = e;
                count--;
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e1) {
                    e1.printStackTrace();
                }
            }
        }

        // Check is Error
        if (count <= 0 && command.mListener != null) {
            command.mListener.onError(error);
        }

        // Check is end and call destroy service
        if (I_COMMAND != null) {
            try {
                if (I_COMMAND.getTaskCount() <= 0)
                    destroyService();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        // Return
        return command.mResult;
    }
500565
public void usage(@Nullable String programName, @Nullable String groupName, String commandName, CommandMetadata command)
    {
        StringBuilder stringBuilder = new StringBuilder();
        usage(programName, groupName, commandName, command, stringBuilder);
        System.out.println(stringBuilder.toString());
    }
684157
public static function description (string $command = "") {
		Bartender::printColored("    - section", "white");
		Bartender::newLine();
		Bartender::printColored("      Make a new section controller in the framework", "white");
		Bartender::newLine();

		Bartender::printColored("    - page", "white");
		Bartender::newLine();
		Bartender::printColored("      Make a new page controller in the framework", "white");
	}
499739
public static void print(String format, Object... args) {

        Object[] stringArgs = new Object[args.length];
        for (int i = 0; i < args.length; i++) {
            stringArgs[i] = ObjectUtils.toString(args[i]);
        }
        print(String.format(format, stringArgs));
    }
401104
def print_help(self, session, command=None):
        
        if command:
            # Single command mode
            if command in self._commands:
                # Argument is a name space
                self.__print_namespace_help(session, command)
                was_namespace = True
            else:
                was_namespace = False

            # Also print the name of matching commands
            try:
                # Extract command name space and name
                possibilities = self.get_ns_commands(command)
            except ValueError as ex:
                # Unknown command
                if not was_namespace:
                    # ... and no name space were matching either -> error
                    session.write_line(str(ex))
                    return False
            else:
                # Print the help of the found command
                if was_namespace:
                    # Give some space
                    session.write_line("\n\n")

                for namespace, cmd_name in possibilities:
                    self.__print_namespace_help(session, namespace, cmd_name)
        else:
            # Get all name spaces
            namespaces = list(self._commands.keys())
            namespaces.remove(DEFAULT_NAMESPACE)
            namespaces.sort()
            namespaces.insert(0, DEFAULT_NAMESPACE)

            first_ns = True
            for namespace in namespaces:
                if not first_ns:
                    # Add empty lines
                    session.write_line("\n\n")

                # Print the help of all commands
                self.__print_namespace_help(session, namespace)
                first_ns = False

        return None
493717
public static void print(String name, Map<?, ?> map) {
		JK.line();
		print(String.format("Map (%s): ", name));
		Set<?> keySet = map.keySet();
		int index = 1;
		for (Object key : keySet) {
			JK.print(String.format("\t%d) Key(%s): Value (%s)", index++, key, map.get(key)));
		}
		JK.line();
	}
510744
def _command(self, commands):
        
        if self._spi == None: raise "Do not setting SPI"
        GPIO.output( self._spi_dc, 0 )
        self._spi.writebytes( commands )
952476
public void printUsage(Command command) {
        String commandName = command.getDescriptor().getName();
        StringBuilder sb = new StringBuilder(getSyntaxPrefix()).append(commandName).append(" ");

        // create a list for processed option groups
        Collection<OptionGroup> processedGroups = new ArrayList<>();

        Collection<Option> optList = command.getOptions().getAllOptions();
        if (optList.size() > 1 && getOptionComparator() != null) {
            List<Option> optList2 = new ArrayList<>(optList);
            optList2.sort(getOptionComparator());
            optList = optList2;
        }

        for (Iterator<Option> it = optList.iterator(); it.hasNext();) {
            // get the next Option
            Option option = it.next();
            // check if the option is part of an OptionGroup
            OptionGroup group = command.getOptions().getOptionGroup(option);
            if (group != null) {
                // if the group has not already been processed
                if (!processedGroups.contains(group)) {
                    // add the group to the processed list
                    processedGroups.add(group);
                    // add the usage clause
                    appendOptionGroup(sb, group);
                }
                // otherwise the option was displayed in the group
                // previously so ignore it.
            }
            // if the Option is not part of an OptionGroup
            else {
                appendOption(sb, option, option.isRequired());
            }
            if (it.hasNext()) {
                sb.append(" ");
            }
        }

        for (Arguments arguments : command.getArgumentsList()) {
            sb.append(" ");
            appendArguments(sb, arguments);
        }

        printWrapped(getSyntaxPrefix().length() + commandName.length() + 1, sb.toString());
    }
1314937
protected function outputCommandHelp()
    {
        $command = $this->getParam(0);

        if (!empty($command)) {
            $this->outputHelp($command);
            $this->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);
        }
    }
1227821
public void bindCommand(Control control, Command command) {
		commands.put(control, command);

		if (commandState.get(command) == null) {
			commandState.put(command, new CommandState());
		}
	}