Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4FAB318981 for ; Fri, 14 Aug 2015 15:41:48 +0000 (UTC) Received: (qmail 19633 invoked by uid 500); 14 Aug 2015 15:41:48 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 19607 invoked by uid 500); 14 Aug 2015 15:41:48 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 19595 invoked by uid 99); 14 Aug 2015 15:41:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2015 15:41:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F03F8E0435; Fri, 14 Aug 2015 15:41:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tylerhobbs@apache.org To: commits@cassandra.apache.org Message-Id: <6e95fbfa61434875843a65462a763302@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cassandra git commit: cqlsh: specify encoding w/ command line option Date: Fri, 14 Aug 2015 15:41:47 +0000 (UTC) Repository: cassandra Updated Branches: refs/heads/cassandra-2.1 972ae1472 -> 7a6a5097a cqlsh: specify encoding w/ command line option Patch by Paulo Motta; reviewed by Tyler Hobbs for CASSANDRA-10004 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7a6a5097 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7a6a5097 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7a6a5097 Branch: refs/heads/cassandra-2.1 Commit: 7a6a5097a35feb830b66a7e602ba3cb1ead2e105 Parents: 972ae14 Author: Paulo Motta Authored: Fri Aug 14 10:40:58 2015 -0500 Committer: Tyler Hobbs Committed: Fri Aug 14 10:40:58 2015 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + bin/cqlsh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a6a5097/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index f7fb63c..5a76978 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.9 + * (cqlsh) Allow encoding to be set through command line (CASSANDRA-10004) * Add new JMX methods to change local compaction strategy (CASSANDRA-9965) * Write hints for paxos commits (CASSANDRA-7342) * (cqlsh) Fix timestamps before 1970 on Windows, always http://git-wip-us.apache.org/repos/asf/cassandra/blob/7a6a5097/bin/cqlsh ---------------------------------------------------------------------- diff --git a/bin/cqlsh b/bin/cqlsh index 69b669d..084d586 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -165,6 +165,9 @@ parser.add_option('-k', '--keyspace', help='Authenticate to the given keyspace.' parser.add_option("-f", "--file", help="Execute commands from FILE, then exit") parser.add_option('--debug', action='store_true', help='Show additional debugging information') +parser.add_option("--encoding", help="Specify a non-default encoding for output. If you are " + + "experiencing problems with unicode characters, using utf8 may fix the problem." + + " (Default from system preferences: %s)" % (locale.getpreferredencoding(),)) parser.add_option("--cqlshrc", help="Specify an alternative cqlshrc file location.") parser.add_option('--cqlversion', default=DEFAULT_CQLVER, help='Specify a particular CQL version (default: %default).' @@ -2331,6 +2334,7 @@ def read_options(cmdlineargs, environment): optvalues.debug = False optvalues.file = None optvalues.ssl = False + optvalues.encoding = None optvalues.tty = sys.stdin.isatty() optvalues.cqlversion = option_with_default(configs.get, 'cql', 'version', DEFAULT_CQLVER) @@ -2461,7 +2465,8 @@ def main(options, hostname, port): ssl=options.ssl, single_statement=options.execute, client_timeout=options.client_timeout, - connect_timeout=options.connect_timeout) + connect_timeout=options.connect_timeout, + encoding=options.encoding) except KeyboardInterrupt: sys.exit('Connection aborted.') except CQL_ERRORS, e: