public abstract class CliTool extends java.lang.Object implements java.util.concurrent.Callable<ExitStatus>
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ARG_OVERWRITE |
protected static java.lang.String |
ARG_VALIDATE |
private boolean |
callSystemExit |
private boolean |
help |
| Constructor and Description |
|---|
CliTool() |
| Modifier and Type | Method and Description |
|---|---|
protected static <T> T |
checkNotNull(T arg) |
private static void |
helpDisplayCommandOptions(java.io.PrintStream pw,
com.beust.jcommander.JCommander jc) |
private static void |
helpDisplayCommandOptions(java.io.PrintStream pw,
java.lang.String command,
com.beust.jcommander.JCommander jc) |
protected static void |
main(java.lang.String[] args,
CliTool... commands)
Parse and execute one of the commands.
|
protected static void |
main(java.lang.String[] args,
CliTool command)
Parse and execute a single command.
|
protected static void |
printf(java.lang.String msg,
java.lang.Object... args) |
void |
setCallSystemExit(boolean flag)
Call
System.exit(int) at the end of command processing. |
protected static final java.lang.String ARG_OVERWRITE
protected static final java.lang.String ARG_VALIDATE
private boolean callSystemExit
private boolean help
public void setCallSystemExit(boolean flag)
System.exit(int) at the end of command processing.flag - Call System.exit(int) if true.protected static void main(java.lang.String[] args,
CliTool... commands)
args - Command line arguments (command and options).commands - A list of commands.protected static void main(java.lang.String[] args,
CliTool command)
args - Command line arguments (command and options).command - The command to execute.protected static void printf(java.lang.String msg,
java.lang.Object... args)
protected static <T> T checkNotNull(T arg)
private static void helpDisplayCommandOptions(java.io.PrintStream pw,
java.lang.String command,
com.beust.jcommander.JCommander jc)
private static void helpDisplayCommandOptions(java.io.PrintStream pw,
com.beust.jcommander.JCommander jc)