static void printUsage(boolean longUsage, String toolName, Command[] commands) { Preconditions.checkNotNull(commands); System.err.println("Usage: bin/hdfs " + toolName + " [COMMAND]"); final HelpCommand helpCommand = new HelpCommand(commands); for (AdminHelper.Command command : commands) { if (longUsage) { System.err.print(command.getLongUsage()); } else { System.err.print(" " + command.getShortUsage()); } } System.err.print(longUsage ? helpCommand.getLongUsage() : (" " + helpCommand.getShortUsage())); System.err.println(); }
static void printUsage(boolean longUsage, String toolName, Command[] commands) { Preconditions.checkNotNull(commands); System.err.println("Usage: bin/hdfs " + toolName + " [COMMAND]"); final HelpCommand helpCommand = new HelpCommand(commands); for (AdminHelper.Command command : commands) { if (longUsage) { System.err.print(command.getLongUsage()); } else { System.err.print(" " + command.getShortUsage()); } } System.err.print(longUsage ? helpCommand.getLongUsage() : (" " + helpCommand.getShortUsage())); System.err.println(); }
static void printUsage(boolean longUsage, String toolName, Command[] commands) { Preconditions.checkNotNull(commands); System.err.println("Usage: bin/hdfs " + toolName + " [COMMAND]"); final HelpCommand helpCommand = new HelpCommand(commands); for (AdminHelper.Command command : commands) { if (longUsage) { System.err.print(command.getLongUsage()); } else { System.err.print(" " + command.getShortUsage()); } } System.err.print(longUsage ? helpCommand.getLongUsage() : (" " + helpCommand.getShortUsage())); System.err.println(); }
static Command determineCommand(String commandName, Command[] commands) { Preconditions.checkNotNull(commands); if (HELP_COMMAND_NAME.equals(commandName)) { return new HelpCommand(commands); } for (Command command : commands) { if (command.getName().equals(commandName)) { return command; } } return null; }
static Command determineCommand(String commandName, Command[] commands) { Preconditions.checkNotNull(commands); if (HELP_COMMAND_NAME.equals(commandName)) { return new HelpCommand(commands); } for (Command command : commands) { if (command.getName().equals(commandName)) { return command; } } return null; }
@Override public String getLongUsage() { final TableListing listing = AdminHelper.getOptionDescriptionListing(); listing.addRow("<command-name>", "The command for which to get " + "detailed help. If no command is specified, print detailed help for " + "all commands"); return getShortUsage() + "\n" + "Get detailed help about a command.\n\n" + listing.toString(); }
@Override public String getLongUsage() { final TableListing listing = AdminHelper.getOptionDescriptionListing(); listing.addRow("<command-name>", "The command for which to get " + "detailed help. If no command is specified, print detailed help for " + "all commands"); return getShortUsage() + "\n" + "Get detailed help about a command.\n\n" + listing.toString(); }
@Override public String getLongUsage() { final TableListing listing = AdminHelper.getOptionDescriptionListing(); listing.addRow("<command-name>", "The command for which to get " + "detailed help. If no command is specified, print detailed help for " + "all commands"); return getShortUsage() + "\n" + "Get detailed help about a command.\n\n" + listing.toString(); }
static Command determineCommand(String commandName, Command[] commands) { Preconditions.checkNotNull(commands); if (HELP_COMMAND_NAME.equals(commandName)) { return new HelpCommand(commands); } for (Command command : commands) { if (command.getName().equals(commandName)) { return command; } } return null; }