public class SpringCli extends Object
Command implementation based on the first argument.
The '-d' and '--debug' switches are handled by this class, however, most argument
parsing is left to the Command implementation.
main(String...),
SpringCliException,
Command| Constructor and Description |
|---|
SpringCli()
Create a new
SpringCli implementation with the default set of commands. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
errorMessage(String message) |
static void |
main(String... args)
The main CLI entry-point.
|
protected void |
printStackTrace(Exception ex) |
protected void |
run(String... args)
Parse the arguments and run a suitable command.
|
int |
runAndHandleErrors(String... args)
Run the CLI and handle and errors.
|
void |
setCommands(List<? extends Command> commands)
Set the command available to the CLI.
|
protected void |
showUsage() |
public static final String CLI_APP
public SpringCli()
SpringCli implementation with the default set of commands.public void setCommands(List<? extends Command> commands)
commands - the commands to addpublic int runAndHandleErrors(String... args)
args - the input argumentsprotected void run(String... args) throws Exception
args - the argumentsExceptionprotected void showUsage()
protected void errorMessage(String message)
protected void printStackTrace(Exception ex)
public static void main(String... args)
args - CLI argumentsCopyright © 2013. All Rights Reserved.