DescribeFunctionCommand extends AbstractCommand { public static AbstractCommand parse(String cmd, ExecutionContext ctx) throws ODPSConsoleException { Matcher m = PATTERN.matcher(cmd); boolean match = m.matches(); if (!match) { return null; } if (m.groupCount() < 3) { throw new ODPSConsoleException(ODPSConsoleConstants.BAD_COMMAND + " Must Specific Function Name."); } String name = m.group(3); return new DescribeFunctionCommand(name, cmd, ctx); } DescribeFunctionCommand(String functionName, String cmd, ExecutionContext context); static void printUsage(PrintStream stream); static AbstractCommand parse(String cmd, ExecutionContext ctx); @Override void run(); static final String[] HELP_TAGS; }
@Test public void testDescFunc() throws ODPSConsoleException, OdpsException { ExecutionContext init = ExecutionContext.init(); AbstractCommand command = DescribeFunctionCommand.parse("desc function console_lower", init); command.execute(); }