tidied up help when ran in interactive mode or via the Command Agent

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@475794 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-11-16 16:17:20 +00:00
parent 4f3f52392d
commit 93ee7d9f5f
1 changed files with 20 additions and 20 deletions

View File

@ -29,6 +29,7 @@ import java.io.PrintStream;
public class ShellCommand extends AbstractCommand { public class ShellCommand extends AbstractCommand {
private boolean interactive; private boolean interactive;
private String[] helpFile;
public ShellCommand() { public ShellCommand() {
@ -37,6 +38,25 @@ public class ShellCommand extends AbstractCommand {
public ShellCommand(boolean interactive) { public ShellCommand(boolean interactive) {
this.interactive = interactive; this.interactive = interactive;
this.helpFile = new String[]{
(interactive ? "Usage: [task] [task-options] [task data]" : "Usage: Main [--extdir <dir>] [task] [task-options] [task data]"),
"",
"Tasks (default task is start):",
" start - Creates and starts a broker using a configuration file, or a broker URI.",
" stop - Stops a running broker specified by the broker name.",
" list - Lists all available brokers in the specified JMX context.",
" query - Display selected broker component's attributes and statistics.",
" browse - Display selected messages in a specified destination.",
"",
"Task Options (Options specific to each task):",
" --extdir <dir> - Add the jar files in the directory to the classpath.",
" --version - Display the version information.",
" -h,-?,--help - Display this help information. To display task specific help, use " + (interactive ? "" : "Main ") + "[task] -h,-?,--help",
"",
"Task Data:",
" - Information needed by each specific task.",
""
};
} }
/** /**
@ -112,24 +132,4 @@ public class ShellCommand extends AbstractCommand {
protected void printHelp() { protected void printHelp() {
GlobalWriter.printHelp(helpFile); GlobalWriter.printHelp(helpFile);
} }
protected String[] helpFile = new String[] {
"Usage: Main [--extdir <dir>] [task] [task-options] [task data]",
"",
"Tasks (default task is start):",
" start - Creates and starts a broker using a configuration file, or a broker URI.",
" stop - Stops a running broker specified by the broker name.",
" list - Lists all available brokers in the specified JMX context.",
" query - Display selected broker component's attributes and statistics.",
" browse - Display selected messages in a specified destination.",
"",
"Task Options (Options specific to each task):",
" --extdir <dir> - Add the jar files in the directory to the classpath.",
" --version - Display the version information.",
" -h,-?,--help - Display this help information. To display task specific help, use Main [task] -h,-?,--help",
"",
"Task Data:",
" - Information needed by each specific task.",
""
};
} }