You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/12/14 00:02:13 UTC

svn commit: r604057 - in /geronimo/gshell/trunk: gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java gshell-parser/src/main/grammar/CommandLineParser.jjt

Author: jdillon
Date: Thu Dec 13 15:02:12 2007
New Revision: 604057

URL: http://svn.apache.org/viewvc?rev=604057&view=rev
Log:
(GSHELL-20) Get set w/" and ' working better

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java
    geronimo/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java?rev=604057&r1=604056&r2=604057&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/SetCommand.java Thu Dec 13 15:02:12 2007
@@ -124,11 +124,21 @@
         NameValue nv = new NameValue();
 
         int i = input.indexOf("=");
+        int firstDoubleQuote = input.indexOf("\"");
+        int firstSingleQuote = input.indexOf("'");
 
         if (i == -1) {
             nv.name = input;
             nv.value = "true";
         }
+        else if ( firstDoubleQuote != -1) {
+        	nv.name = input.substring(0,i);
+        	nv.value = input.substring(firstDoubleQuote + 1, input.length()-1); 
+        } 
+        else if ( firstSingleQuote != -1) {
+        	nv.name = input.substring(0,i);
+        	nv.value = input.substring(firstSingleQuote + 1, input.length()-1); 
+        } 
         else {
             nv.name = input.substring(0, i);
             nv.value = input.substring(i + 1, input.length());

Modified: geronimo/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt?rev=604057&r1=604056&r2=604057&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt (original)
+++ geronimo/gshell/trunk/gshell-parser/src/main/grammar/CommandLineParser.jjt Thu Dec 13 15:02:12 2007
@@ -111,6 +111,12 @@
             | ["0"-"3"] ["0"-"7"] ["0"-"7"]
             )
           )
+        | ( "="
+        	( <QUOTED_STRING> )
+          )
+        | ( "="
+        	( <OPAQUE_STRING> )
+          )        	
       )+
     >
 |
@@ -139,6 +145,9 @@
       )*
       "\""
     >
+    
+|
+	< SET_QUOTED_STRING >
 }
 
 //