Package org.apache.sis.console
Class HelpCommand
java.lang.Object
org.apache.sis.console.CommandRunner
org.apache.sis.console.HelpCommand
The "help" subcommand.
- Since:
- 0.3
- Version:
- 0.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]
The commands, in the order to be shown.Fields inherited from class org.apache.sis.console.CommandRunner
colors, commandName, debug, encoding, err, files, instance, locale, options, out, outputBuffer, TEST, timezone
-
Constructor Summary
ConstructorsConstructorDescriptionHelpCommand
(int commandIndex, String... arguments) Creates the"help"
sub-command.HelpCommand
(CommandRunner parent) Copies the configuration of the given sub-command. -
Method Summary
Methods inherited from class org.apache.sis.console.CommandRunner
canNotOpen, error, hasContradictoryOptions, hasUnexpectedFileCount, help, useStandardInput
-
Field Details
-
COMMANDS
The commands, in the order to be shown.
-
-
Constructor Details
-
HelpCommand
HelpCommand(CommandRunner parent) Copies the configuration of the given sub-command. This constructor is used for printing help about another command. -
HelpCommand
HelpCommand(int commandIndex, String... arguments) throws InvalidOptionException Creates the"help"
sub-command.- Parameters:
commandIndex
- index of thearguments
element containing the"help"
command name, or -1 if none.arguments
- the command-line arguments provided by the user.- Throws:
InvalidOptionException
- if an illegal option has been provided, or the option has an illegal value.
-
-
Method Details
-
run
Prints the help instructions.- Specified by:
run
in classCommandRunner
- Returns:
- 0 on success, or an exit code if the command failed for a reason other than a Java exception.
- Throws:
IOException
- should never happen, because we are writing to aPrintWriter
.
-
help
void help(boolean showHeader, String[] commandNames, EnumSet<Option> validOptions) throws IOException Implementation ofrun()
, also shared byCommandRunner.help(String)
.- Parameters:
showHeader
-true
for printing the "Apache SIS" header.commandNames
- the names of the commands to list.validOptions
- the options to list.- Throws:
IOException
- should never happen, because we are writing to aPrintWriter
.
-