cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1062910 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/cli/CliMain.java
Date Mon, 24 Jan 2011 18:20:25 GMT
Author: jbellis
Date: Mon Jan 24 18:20:25 2011
New Revision: 1062910

URL: http://svn.apache.org/viewvc?rev=1062910&view=rev
Log:
add single-line "--" comments to CLI
patch by Pavel Yaskevich; reviewed by jbellis for CASSANDRA-2032

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1062910&r1=1062909&r2=1062910&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Jan 24 18:20:25 2011
@@ -35,6 +35,7 @@
    joining the ring (CASSANDRA-526)
  * log migrations at INFO (CASSANDRA-2028)
  * add CLI verbose option in file mode (CASSANDRA-2030)
+ * add single-line "--" comments to CLI (CASSANDRA-2032)
 
 
 0.7.0-final

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java?rev=1062910&r1=1062909&r2=1062910&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/cli/CliMain.java Mon Jan
24 18:20:25 2011
@@ -338,7 +338,8 @@ public class CliMain
 
             line = line.trim();
 
-            if (line.isEmpty())
+            // skipping empty and comment lines
+            if (line.isEmpty() || line.startsWith("--"))
                 continue;
 
             currentStatement += line;
@@ -364,10 +365,12 @@ public class CliMain
 
         while ((line = reader.readLine()) != null)
         {
-            if (line.isEmpty())
+            line = line.trim();
+
+            // skipping empty and comment lines
+            if (line.isEmpty() || line.startsWith("--"))
                 continue;
 
-            line = line.trim();
             currentStatement += line;
 
             if (line.endsWith(";"))



Mime
View raw message