summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-08-02 18:49:37 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-08-02 18:49:37 -0300
commit4cfb40c605a6df4bf70bc14e2010ad78e4276324 (patch)
tree9d4325b10646456b55eb7c6fddeffef3a03a3625
parentcfd43d8dcf3a50ce4855cc0d88dc3244120d3a3e (diff)
downloadkeyringer-4cfb40c605a6df4bf70bc14e2010ad78e4276324.tar.gz
keyringer-4cfb40c605a6df4bf70bc14e2010ad78e4276324.tar.bz2
Fixing initial options on bash completion
-rw-r--r--lib/keyringer/completions/bash8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/keyringer/completions/bash b/lib/keyringer/completions/bash
index 0edfb1b..3c08293 100644
--- a/lib/keyringer/completions/bash
+++ b/lib/keyringer/completions/bash
@@ -31,20 +31,22 @@ _keyringer() {
# Initial options
config="$HOME/.keyringer"
- opts="`ls $config | sed -e 's/config//'`"
+ keyrings="`ls $config | sed -e 's/config//'`"
# Process config
source $config/config
path="`eval echo '$'$instance`"
# Available instances
- instances="`echo $opts | sed -e 's/ /|/'`"
+ instances="`echo $keyrings | sed -e 's/ /|/'`"
# The current instance
instance="${COMP_WORDS[1]}"
# Command completions
- if [ "${#COMP_WORDS[@]}" == "3" ] && echo "${prev}" | grep -qe "[$instances]"; then
+ if [ "${#COMP_WORDS[@]}" == "2" ]; then
+ opts="$keyrings"
+ elif [ "${#COMP_WORDS[@]}" == "3" ] && echo "${prev}" | grep -qe "[$instances]"; then
opts="`keyringer $instance commands`"
elif [ "${#COMP_WORDS[@]}" == "4" ]; then
case "${prev}" in