cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eev...@apache.org
Subject svn commit: r1085113 - /cassandra/trunk/drivers/py/cqlsh
Date Thu, 24 Mar 2011 20:21:48 GMT
Author: eevans
Date: Thu Mar 24 20:21:47 2011
New Revision: 1085113

URL: http://svn.apache.org/viewvc?rev=1085113&view=rev
Log:
cqlsh command completion for DROP

Patch by eevans

Modified:
    cassandra/trunk/drivers/py/cqlsh

Modified: cassandra/trunk/drivers/py/cqlsh
URL: http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/cqlsh?rev=1085113&r1=1085112&r2=1085113&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/cqlsh (original)
+++ cassandra/trunk/drivers/py/cqlsh Thu Mar 24 20:21:47 2011
@@ -135,8 +135,14 @@ class Shell(cmd.Cmd):
             return startswith(common, text.upper()) + startswith(props, text)
     complete_CREATE = complete_create
         
+    def complete_drop(self, text, line, begidx, endidx):
+        words = line.split()
+        if len(words) < 3:
+            return startswith(['COLUMNFAMILY', 'KEYSPACE'], text.upper())
+    complete_DROP = complete_drop
+
     def completenames(self, text, *ignored):
-        cmds = startswith(('USE', 'SELECT', 'UPDATE', 'DELETE', 'CREATE'),
+        cmds = startswith(('USE', 'SELECT', 'UPDATE', 'DELETE', 'CREATE', 'DROP'),
                           text.upper())
         return cmd.Cmd.completenames(self, text, ignored) + cmds
 



Mime
View raw message