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 5F1D7104D9 for ; Wed, 18 Dec 2013 09:36:49 +0000 (UTC) Received: (qmail 31077 invoked by uid 500); 18 Dec 2013 09:36:29 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 30765 invoked by uid 500); 18 Dec 2013 09:36:19 -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 30475 invoked by uid 99); 18 Dec 2013 09:36:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Dec 2013 09:36:13 +0000 Date: Wed, 18 Dec 2013 09:36:13 +0000 (UTC) From: "Cyril Scetbon (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-6421) Add bash completion to nodetool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13851480#comment-13851480 ] Cyril Scetbon edited comment on CASSANDRA-6421 at 12/18/13 9:36 AM: -------------------------------------------------------------------- Sorry I didn't see the comment :( [~lyubent] that's what you should get. I'm on OSX and using bash completion 1.3 from Homebrew : {code} $ brew list bash-completion /usr/local/Cellar/bash-completion/1.3/etc/bash_completion.d/ (180 files) /usr/local/Cellar/bash-completion/1.3/etc/profile.d/bash_completion.sh /usr/local/Cellar/bash-completion/1.3/etc/bash_completion {code} have is a bash-completion function. Tell me the ./nodetool is not executing the bash completion script :) To use it, you have to - place the file in your bash_completion.d directory (in my case xxxx) : {code} $ ls /usr/local/etc/bash_completion.d/node* /usr/local/etc/bash_completion.d/nodetool {code} - add the following (add absolute path if you don't use hombrew) in your ~/.bash_profile : {code} if [ -f `brew --prefix`/etc/bash_completion ]; then . `brew --prefix`/etc/bash_completion fi {code} - start a new bash session and try : {code} nodetool cfh[TAB] nodetool cfhistograms [TAB][TAB] pns_fr system system_auth system_traces test nodetool cfhistograms system HintsColumnFamily Migrations batchlog peer_events schema_columnfamilies IndexInfo NodeIdInfo hints peers schema_columns LocationInfo Schema local range_xfers schema_keyspaces {code} As you see after cfh has been completed to cfhistograms if you add 2 more \[TAB\] you get the name of keyspaces, and if you add the name of the keyspace system and 2 more \[TAB\] you get names of column families :) The first word is the nodetool script from cassandra, not the bash completion script was (Author: cscetbon): Sorry I didn't see the comment :( [~lyubent] that's what you should get. I'm on OSX and using bash completion 1.3 from Homebrew : {code} $ brew list bash-completion /usr/local/Cellar/bash-completion/1.3/etc/bash_completion.d/ (180 files) /usr/local/Cellar/bash-completion/1.3/etc/profile.d/bash_completion.sh /usr/local/Cellar/bash-completion/1.3/etc/bash_completion {code} have is a bash-completion function. Tell me the ./nodetool is not executing the bash completion script :) To use it, you have to - place the file in your bash_completion.d directory (in my case xxxx) : {code} $ ls /usr/local/etc/bash_completion.d/node* /usr/local/etc/bash_completion.d/nodetool {code} - add the following (add absolute path if you don't use hombrew) in your ~/.bash_profile : {code} if [ -f `brew --prefix`/etc/bash_completion ]; then . `brew --prefix`/etc/bash_completion fi {code} - start a new bash session and try : {code} nodetool cfh[TAB] nodetool cfhistograms [TAB][TAB] pns_fr system system_auth system_traces test nodetool cfhistograms system HintsColumnFamily Migrations batchlog peer_events schema_columnfamilies IndexInfo NodeIdInfo hints peers schema_columns LocationInfo Schema local range_xfers schema_keyspaces {code} As you see after cfh has been completed to cfhistograms if you add 2 more \[TAB\] you get the name of keyspaces, and if you add the name of the keyspace system and 2 more \[TAB\] you get names of column families :) The first word is the nodetool script from cassandra, not the bash completion script > Add bash completion to nodetool > ------------------------------- > > Key: CASSANDRA-6421 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6421 > Project: Cassandra > Issue Type: Improvement > Components: Tools > Reporter: Cyril Scetbon > Assignee: Cyril Scetbon > Priority: Trivial > Fix For: 2.0.4 > > > You can find the patch from my commit here : > https://github.com/cscetbon/cassandra/commit/07a10b99778f14362ac05c70269c108870555bf3.patch > it uses cqlsh to get keyspaces and namespaces and could use an environment variable (not implemented) to get access which cqlsh if authentification is needed. But I think that's really a good start :) -- This message was sent by Atlassian JIRA (v6.1.4#6159)