DShipCommand extends AbstractCommand { public static DShipCommand parse(String commandString, ExecutionContext sessionContext) { String readCommandString = commandString; if ("TUNNEL".equalsIgnoreCase(readCommandString.trim()) || readCommandString.toUpperCase().matches("\\s*TUNNEL\\s+.*")) { readCommandString = readCommandString.trim().replaceAll("\\s+", " "); return new DShipCommand(readCommandString, sessionContext); } return null; } DShipCommand(String commandText, ExecutionContext context); static void printUsage(PrintStream out); static DShipCommand parse(String commandString, ExecutionContext sessionContext); void run(); static final String[] HELP_TAGS; }
@Test public void testHelpCommand() throws OdpsException, ODPSConsoleException { ExecutionContext context = ExecutionContext.init(); DShipCommand command = DShipCommand.parse("tunnel help upload", context); String result = ODPSConsoleUtils.runCommand(command); System.out.println(result); assertFalse(result.contains("--")); }