/** * Utility method for getting a short help string for a server. Basically it contains an * introductory message and also lists all available apps for the server. * * @param server the server to ask for * @return the short introductory help string. */ public static void printHelpString(Output out, ShellServer server, boolean list) throws ShellException, RemoteException { String header = "Available commands:"; if (list) { out.println(header); out.println(); for (String command : server.getAllAvailableCommands()) { out.println(" " + command); } out.println(); } else { out.println(header + " " + availableCommandsAsString(server)); } out.println("Use " + getShortUsageString() + " for info about each command."); }
@Override public void leave(Serializable clientID) throws RemoteException { actual.leave(clientID); }
@Override public String[] getAllAvailableCommands() throws RemoteException { return actual.getAllAvailableCommands(); }
@Override public void terminate(Serializable clientID) throws RemoteException { actual.terminate(clientID); }
@Override public Welcome welcome(Map<String, Serializable> initialSession) throws RemoteException, ShellException { return actual.welcome(initialSession); }
@Override public Serializable interpretVariable(Serializable clientId, String key) throws ShellException, RemoteException { return actual.interpretVariable(clientId, key); }
@Override public Response interpretLine(Serializable clientId, String line, Output out) throws ShellException, RemoteException { return actual.interpretLine(clientId, line, out); }
@Override public String getName() throws RemoteException { return actual.getName(); }
@Override public void setSessionVariable(Serializable clientID, String key, Object value) throws RemoteException, ShellException { actual.setSessionVariable(clientID, key, value); }
@Override public TabCompletion tabComplete(Serializable clientId, String partOfLine) throws ShellException, RemoteException { return actual.tabComplete(clientId, partOfLine); }