Updated Branches: refs/heads/cassandra-1.2 54c15d826 -> 67e57a974
cqlsh: add custom prompt support patch by Cyril Scetbon; reviewed by Aleksey Yeschenko for CASSANDRA-5539 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/67e57a97 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/67e57a97 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/67e57a97 Branch: refs/heads/cassandra-1.2 Commit: 67e57a974f7fe5f7b950fa370b665ba828f6e5e1 Parents: 54c15d8 Author: Aleksey Yeschenko <[email protected]> Authored: Sat May 25 04:08:16 2013 +0300 Committer: Aleksey Yeschenko <[email protected]> Committed: Sat May 25 04:08:16 2013 +0300 ---------------------------------------------------------------------- CHANGES.txt | 1 + bin/cqlsh | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/67e57a97/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index b687570..1acf84e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ * Check only SSTables for the requested range when streaming (CASSANDRA-5569) * Improve batchlog replay behavior and hint ttl handling (CASSANDRA-5314) * Exclude localTimestamp from validation for tombstones (CASSANDRA-5398) + * cqlsh: add custom prompt support (CASSANDRA-5539) Merged from 1.1: * Remove buggy thrift max message length option (CASSANDRA-5529) * Fix NPE in Pig's widerow mode (CASSANDRA-5488) http://git-wip-us.apache.org/repos/asf/cassandra/blob/67e57a97/bin/cqlsh ---------------------------------------------------------------------- diff --git a/bin/cqlsh b/bin/cqlsh index 2f6568a..f96cb23 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -32,7 +32,7 @@ exit 1 from __future__ import with_statement description = "CQL Shell for Apache Cassandra" -version = "3.0.2" +version = "3.0.3" from StringIO import StringIO from itertools import groupby @@ -448,9 +448,12 @@ def describe_interval(seconds): return words class Shell(cmd.Cmd): - default_prompt = "cqlsh> " + custom_prompt = os.getenv('CQLSH_PROMPT', '') + if custom_prompt is not '': + custom_prompt += "\n" + default_prompt = custom_prompt + "cqlsh> " continue_prompt = " ... " - keyspace_prompt = "cqlsh:%s> " + keyspace_prompt = custom_prompt + "cqlsh:%s> " keyspace_continue_prompt = "%s ... " num_retries = 4 show_line_nums = False
