Package picocli
Interface CommandLine.IHelpCommandInitializable
-
- All Known Implementing Classes:
CommandLine.HelpCommand
- Enclosing class:
- CommandLine
@Deprecated public static interface CommandLine.IHelpCommandInitializableDeprecated.useCommandLine.IHelpCommandInitializable2insteadHelp commands that provide usage help for other commands can implement this interface to be initialized with the information they need.The
CommandLine::printHelpIfRequestedmethod calls theinitmethod on commands marked ashelpCommandbefore the help command'srunorcallmethod is called.Implementation note:
If an error occurs in the
runorcallmethod while processing the help request, it is recommended custom Help commands throw aParameterExceptionwith a reference to the parent command. TheDefaultExceptionHandlerwill print the error message and the usage for the parent command, and will terminate with the exit code of the exception handler if one was set.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidinit(CommandLine helpCommandLine, CommandLine.Help.Ansi ansi, java.io.PrintStream out, java.io.PrintStream err)Deprecated.
-
-
-
Method Detail
-
init
@Deprecated void init(CommandLine helpCommandLine, CommandLine.Help.Ansi ansi, java.io.PrintStream out, java.io.PrintStream err)
Deprecated.Initializes this object with the information needed to implement a help command that provides usage help for other commands.- Parameters:
helpCommandLine- theCommandLineobject 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
-
-