Merge pull request #74 from victorcoder/master
gem completion speedup
diff --git a/completion/available/gem.completion.bash b/completion/available/gem.completion.bash
index 7231eef..de986e0 100644
--- a/completion/available/gem.completion.bash
+++ b/completion/available/gem.completion.bash
@@ -1,22 +1,22 @@
#!/usr/bin/env bash
# Completion for gem
-if [ -z "$REMOTE_GEMS" ]
-then
- REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') )
-fi
-
-if [ -z "$LOCAL_GEMS" ]
-then
- LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') )
-fi
-
_installcomp() {
+ if [ -z "$REMOTE_GEMS" ]
+ then
+ REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') )
+ fi
+
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) )
}
_uninstallcomp() {
+ if [ -z "$LOCAL_GEMS" ]
+ then
+ LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') )
+ fi
+
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) )
}
diff --git a/install.sh b/install.sh
index 74ff697..f84c097 100755
--- a/install.sh
+++ b/install.sh
@@ -48,6 +48,7 @@
case $RESP in
[yY])
ln -s "$BASH/$file_type/available/$file" "$BASH/$file_type/enabled"
+ break
;;
[nN])
break