protected String getHeader(CmdLineAction action) { return "** Action Help for '" + action.getName() + "' **"; }
@Override public void execute(ActionMessagePrinter printer) { Validate.notNull(message, "Must specify message"); printer.print(message); }
@Override public void close() throws IOException { super.close(); printer.println(sb.toString()); } };
protected String getDescription(CmdLineAction action) { StringBuilder sb = new StringBuilder("> DESCRIPTION:\n"); if (action.getDetailedDescription() != null) { sb.append(" ").append(action.getDetailedDescription() .replaceAll("^\\s*", "").replaceAll("\\s*$", "")); } else if (action.getDescription() != null) { sb.append(" ").append( action.getDescription().replaceAll("^\\s*", "") .replaceAll("\\s*$", "")); } else { sb.append(" - N/A"); } return sb.append("\n").toString(); }
protected String getExamples(CmdLineAction action) { StringBuilder sb = new StringBuilder("> EXAMPLES:\n"); if (action.getExamples() != null) { sb.append(" ").append(action.getExamples().replaceAll("^\\s*", "") .replaceAll("\\s*$", "")); } else { sb.append(" - N/A"); } return sb.toString(); }
private void handleSettingNameForCmdLineActions() { @SuppressWarnings("unchecked") Map<String, CmdLineAction> beans = appContext .getBeansOfType(CmdLineAction.class); for (Entry<String, CmdLineAction> entry : beans.entrySet()) { entry.getValue().setName(entry.getKey()); } } }
@Override public void close() throws IOException { super.close(); printer.println(sb.toString()); } };
protected String getHeader(CmdLineAction action) { return "** Action Help for '" + action.getName() + "' **"; }
@Override public void execute(ActionMessagePrinter printer) { Validate.notNull(message, "Must specify message"); printer.print(message); }
protected String getExamples(CmdLineAction action) { StringBuilder sb = new StringBuilder("> EXAMPLES:\n"); if (action.getExamples() != null) { sb.append(" ").append(action.getExamples().replaceAll("^\\s*", "") .replaceAll("\\s*$", "")); } else { sb.append(" - N/A"); } return sb.toString(); }
public Relation getRelation(CmdLineAction action) { Validate.notNull(actionName); Validate.notNull(relation); Validate.notNull(action); if (action.getName().equals(actionName)) { return relation; } return Relation.NONE; }
public Relation getRelation(CmdLineAction action) { Validate.notNull(actionName); Validate.notNull(relation); Validate.notNull(action); if (action.getName().equals(actionName)) { return relation; } return Relation.NONE; }
public String getArgDescription(CmdLineAction action, CmdLineOption option) { return getArgDescription(action.getName()); } }
public String getDescription(CmdLineAction action, CmdLineOption option) { return getDescription(action.getName()); }
public String getArgDescription(CmdLineAction action, CmdLineOption option) { return getArgDescription(action.getName()); } }
public String getDescription(CmdLineAction action, CmdLineOption option) { return getDescription(action.getName()); }