From 4c452887906858c3dbb69d000c5a930752d945a5 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 26 Sep 2012 09:59:55 -0500 Subject: [PATCH 1/3] cqlsh: alphabetize help Patch by Aleksey Yeschenko, reviewed by brandonwilliams for CASSANDRA-4034 --- bin/cqlsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cqlsh b/bin/cqlsh index 4e93db7ce9..f984618d41 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -1884,7 +1884,7 @@ class Shell(cmd.Cmd): return names def columnize(self, slist, *a, **kw): - return cmd.Cmd.columnize(self, [u.upper() for u in slist], *a, **kw) + return cmd.Cmd.columnize(self, sorted([u.upper() for u in slist]), *a, **kw) def do_help(self, parsed): """ From d7e4c4a22a938d6c9b48e810ebb315020dfeea88 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 26 Sep 2012 10:02:33 -0500 Subject: [PATCH 2/3] cqlsh: autocomplete fqdn Patch by Aleksey Yeschenko, reviewed by brandonwilliams for CASSANDRA-4423 --- pylib/cqlshlib/cql3handling.py | 5 ++++- pylib/cqlshlib/cqlhandling.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index a08174196d..20d1eec6c0 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -490,7 +490,10 @@ def create_ks_opt_completer(ctxt, cass): return ['strategy_class ='] vals = ctxt.get_binding('optval') stratclass = dequote_value(vals[stratopt]) - if stratclass in ('SimpleStrategy', 'OldNetworkTopologyStrategy'): + if stratclass in ('SimpleStrategy', + 'org.apache.cassandra.locator.SimpleStrategy', + 'OldNetworkTopologyStrategy', + 'org.apache.cassandra.locator.OldNetworkTopologyStrategy'): return ['strategy_options:replication_factor ='] return [Hint('')] diff --git a/pylib/cqlshlib/cqlhandling.py b/pylib/cqlshlib/cqlhandling.py index 715f6f9803..a3fb88fe6e 100644 --- a/pylib/cqlshlib/cqlhandling.py +++ b/pylib/cqlshlib/cqlhandling.py @@ -768,7 +768,10 @@ def create_ks_opt_completer(ctxt, cass): return ['strategy_class ='] vals = ctxt.get_binding('optval') stratclass = dequote_value(vals[stratopt]) - if stratclass in ('SimpleStrategy', 'OldNetworkTopologyStrategy'): + if stratclass in ('SimpleStrategy', + 'org.apache.cassandra.locator.SimpleStrategy', + 'OldNetworkTopologyStrategy', + 'org.apache.cassandra.locator.OldNetworkTopologyStrategy'): return ['strategy_options:replication_factor ='] return [Hint('')] From 83b6f2229a2e6c7abcdb0de4b433e92f2139f939 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Wed, 26 Sep 2012 10:04:56 -0500 Subject: [PATCH 3/3] cqlsh: fix extra space in tab completion Patch by Aleksey Yeschenko, reviewed by brandonwilliams for CASSANDRA-4334 --- pylib/cqlshlib/cqlhandling.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylib/cqlshlib/cqlhandling.py b/pylib/cqlshlib/cqlhandling.py index a3fb88fe6e..0faabc3d0b 100644 --- a/pylib/cqlshlib/cqlhandling.py +++ b/pylib/cqlshlib/cqlhandling.py @@ -280,7 +280,9 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet): candidates = newcandidates # append a space for single, complete identifiers - if len(candidates) == 1 and candidates[0][-1].isalnum(): + if len(candidates) == 1 and candidates[0][-1].isalnum() \ + and lasttype != 'unclosedString' \ + and lasttype != 'unclosedName': candidates[0] += ' ' return candidates, hints