Class HelpCommand
java.lang.Object
org.dellroad.jct.core.simple.AbstractSimpleCommand
org.dellroad.jct.core.simple.command.HelpCommand
- All Implemented Interfaces:
SimpleCommand
A simple "help" command that can be used with a console component extending
SimpleCommandSupport
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
execute
(ConsoleSession<?, ?> session, String name, List<String> args) Execute this command in the current thread and return success or failure.static void
listCommands
(PrintStream out, Collection<? extends CommandBundle> bundles) Pretty-print command names and descriptions.Methods inherited from class org.dellroad.jct.core.simple.AbstractSimpleCommand
getHelpDetail, getHelpSummary, getUsage, printUsage
-
Constructor Details
-
HelpCommand
public HelpCommand()
-
-
Method Details
-
listCommands
Pretty-print command names and descriptions.- Parameters:
out
- where to printbundles
- command bundles- Throws:
IllegalArgumentException
- if any parameter is null
-
execute
public int execute(ConsoleSession<?, ?> session, String name, List<String> args) throws InterruptedExceptionDescription copied from interface:SimpleCommand
Execute this command in the current thread and return success or failure.In the failure case, some error information should be written to standard error.
- Parameters:
session
- associated sessionname
- the name under which this command was invokedargs
- zero or more command arguments (does not include command name)- Returns:
- zero if successful, non-zero error code if an error occurred
- Throws:
InterruptedException
- if execution is interrupted
-