public static final class CommandLine.HelpCommand extends java.lang.Object implements CommandLine.IHelpCommandInitializable, java.lang.Runnable
// print help for subcommand command help subcommand
When invoked without additional parameters, it prints usage help for the parent command. For example:
// print help for command command helpFor internationalization: this command has a
--help option with descriptionKey = "helpCommand.help",
and a COMMAND positional parameter with descriptionKey = "helpCommand.command".| Constructor and Description |
|---|
HelpCommand() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(CommandLine helpCommandLine,
CommandLine.Help.Ansi ansi,
java.io.PrintStream out,
java.io.PrintStream err)
Initializes this object with the information needed to implement a help command that provides usage help for other commands.
|
void |
run()
Invokes
usage for the specified command, or for the parent command. |
public void run()
usage for the specified command, or for the parent command.run in interface java.lang.Runnablepublic void init(CommandLine helpCommandLine, CommandLine.Help.Ansi ansi, java.io.PrintStream out, java.io.PrintStream err)
init in interface CommandLine.IHelpCommandInitializablehelpCommandLine - the CommandLine object associated with this help command. Implementors can use
this to walk the command hierarchy and get access to the help command's parent and sibling commands.ansi - whether to use Ansi colors or notout - the stream to print the usage help message toerr - the error stream to print any diagnostic messages to, in addition to the output from the exception handler