modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java | 28 +++++----- 1 file changed, 14 insertions(+), 14 deletions(-)
New commits: commit 522ff41ba7077e18f43cc053e6ec1eb9cb63fce5 Author: John Sanda jsanda@redhat.com Date: Thu May 31 19:19:39 2012 -0400
[BZ 824129] Do not treat quotes as ordinary characters
I am not sure why but we were treating both single and double quotes as ordinary word character instead of quote or string delimiters.
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java index 308d6c1..2d0e41a 100644 --- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java +++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java @@ -22,9 +22,6 @@ */ package org.rhq.enterprise.client;
-import gnu.getopt.Getopt; -import gnu.getopt.LongOpt; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; @@ -35,6 +32,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map;
+import org.rhq.core.domain.auth.Subject; +import org.rhq.enterprise.client.commands.ClientCommand; +import org.rhq.enterprise.client.commands.ScriptCommand; +import org.rhq.enterprise.client.script.CommandLineParseException; +import org.rhq.enterprise.clientapi.RemoteClient; + +import gnu.getopt.Getopt; +import gnu.getopt.LongOpt; import jline.ArgumentCompletor; import jline.Completor; import jline.ConsoleReader; @@ -42,12 +47,6 @@ import jline.MultiCompletor; import jline.SimpleCompletor; import mazz.i18n.Msg;
-import org.rhq.core.domain.auth.Subject; -import org.rhq.enterprise.client.commands.ClientCommand; -import org.rhq.enterprise.client.commands.ScriptCommand; -import org.rhq.enterprise.client.script.CommandLineParseException; -import org.rhq.enterprise.clientapi.RemoteClient; - /** * @author Greg Hinkle * @author Simeon Pinder @@ -411,13 +410,14 @@ public class ClientMain { List<String> args = new ArrayList<String>(); boolean keep_going = true;
- // we don't want to parse numbers and we want ' to be a normal word - // character strtok.ordinaryChars('0', '9'); strtok.ordinaryChar('.'); strtok.ordinaryChar('-'); - strtok.ordinaryChar('''); - strtok.wordChars(33, 127); + strtok.quoteChar('''); + strtok.quoteChar('"'); + strtok.wordChars(33, 33); + strtok.wordChars(35, 38); + strtok.wordChars(40, 127);
// parse the command line while (keep_going) { @@ -431,7 +431,7 @@ public class ClientMain {
if (nextToken == java.io.StreamTokenizer.TT_WORD) { args.add(strtok.sval); - } else if (nextToken == '"') { + } else if (nextToken == '"' || nextToken == ''') { args.add(strtok.sval); } else if ((nextToken == java.io.StreamTokenizer.TT_EOF) || (nextToken == java.io.StreamTokenizer.TT_EOL)) { keep_going = false;
rhq-commits@lists.fedorahosted.org