/** * Get the usage string for a command. * * @param args the arguments * @param level the depth of the command * @param cmd the command annotation * @return the usage string */ protected String getUsage(String[] args, int level, Command cmd) { final StringBuilder command = new StringBuilder(); command.append('/'); for (int i = 0; i <= level; ++i) { command.append(args[i]); command.append(' '); } command.append(getArguments(cmd)); final String help = cmd.help(); if (!help.isEmpty()) { command.append("\n\n"); command.append(help); } return command.toString(); }
final CharSequence arguments = getArguments(cmd); for (String alias : cmd.aliases()) { final String helpMessage = "/" + alias + " " + arguments + "\n\n" + help;
/** * Get the usage string for a command. * * @param args the arguments * @param level the depth of the command * @param cmd the command annotation * @return the usage string */ protected String getUsage(String[] args, int level, Command cmd) { final StringBuilder command = new StringBuilder(); command.append('/'); for (int i = 0; i <= level; ++i) { command.append(args[i]); command.append(' '); } command.append(getArguments(cmd)); final String help = cmd.help(); if (!help.isEmpty()) { command.append("\n\n"); command.append(help); } return command.toString(); }
final CharSequence arguments = getArguments(cmd); for (String alias : cmd.aliases()) { final String helpMessage = "/" + alias + " " + arguments + "\n\n" + help;