You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2004/11/11 21:32:10 UTC
svn commit: rev 57470 - geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli
Author: ammulder
Date: Thu Nov 11 12:32:08 2004
New Revision: 57470
Modified:
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
Log:
Don't blow up if certain arguments are omitted (GERONIMO-475)
Say what an invalid command was, so it's clearer what is wrong
with a command line where the command was not recognized
Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/DeployTool.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/DeployTool.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/DeployTool.java Thu Nov 11 12:32:08 2004
@@ -102,6 +102,8 @@
} else {
DeployCommand dc = getCommand(command);
if(dc == null) {
+ out.println();
+ processException(out, new DeploymentSyntaxException("No such command: '"+command+"'"));
showHelp(out, new String[0]);
} else {
ServerConnection con = null;
Modified: geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
==============================================================================
--- geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java (original)
+++ geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java Thu Nov 11 12:32:08 2004
@@ -83,21 +83,29 @@
if(arg.equals("--uri") || arg.equals("--url")) {
if(uri != null) {
throw new DeploymentSyntaxException("Cannot specify more than one URI");
+ } else if(i >= args.length-1) {
+ throw new DeploymentSyntaxException("Must specify a URI (--uri deployer:...)");
}
uri = args[++i];
} else if(arg.equals("--driver")) {
if(driver != null) {
throw new DeploymentSyntaxException("Cannot specify more than one driver");
+ } else if(i >= args.length-1) {
+ throw new DeploymentSyntaxException("Must specify a driver JAR (--driver jarfile)");
}
driver = args[++i];
} else if(arg.equals("--user")) {
if(user != null) {
throw new DeploymentSyntaxException("Cannot specify more than one user name");
+ } else if(i >= args.length-1) {
+ throw new DeploymentSyntaxException("Must specify a username (--user username)");
}
user = args[++i];
} else if(arg.equals("--password")) {
if(password != null) {
throw new DeploymentSyntaxException("Cannot specify more than one password");
+ } else if(i >= args.length-1) {
+ throw new DeploymentSyntaxException("Must specify a password (--password password)");
}
password = args[++i];
} else {