Class CommandLine
java.lang.Object
net.adoptopenjdk.icedteaweb.client.commandline.CommandLine
Encapsulates a command line interface to the deployment configuration.
The central method is handle(), which calls one of the
various 'handle' methods. The commands listed in CommandLineOptions.getItwsettingsCommands
are supported. For each supported command, a method handleCOMMANDCommand exists.
This method actually takes action based on the command. Generally, a
printCOMMANDHelp method also exists, and prints out the help message for
that specific command. For example, see handleListCommand()
and printListHelp().
CommandLine cli = new CommandLine();
// the string array represents input using the command line
int retVal = cli.handle(new String[] { "help" });
if (retVal == CommandLine.SUCCESS) {
// good!
} else {
// bad!
}
- Author:
- Omair Majid
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninthandle()Handles overall command line arguments.intHandles the 'set' commandstatic voidThe starting point of the program
-
Field Details
-
ERROR
public static final int ERROR- See Also:
-
SUCCESS
public static final int SUCCESS- See Also:
-
-
Constructor Details
-
CommandLine
Creates a new instance- Parameters:
optionParser- used to parse applications arguments
-
-
Method Details
-
handleSetCommand
public int handleSetCommand()Handles the 'set' command- Returns:
- an integer indicating success (SUCCESS) or error in handling the command
-
handle
public int handle()Handles overall command line arguments. The argument array is split into two pieces: the first element is assumed to be the command, and everything after is taken to be the argument to the command.- Returns:
- an integer representing an error code or SUCCESS if no problems occurred.
-
main
The starting point of the program- Parameters:
args- the command line arguments to this program
-