The following commit has been merged in the master branch:
commit 6edad88daa42d779e212f0318861d3b45d07b973
Author: Ville Skyttä <[email protected]>
Date:   Sun Apr 19 17:33:55 2009 +0300

    Split valid shell completion to _shells().

diff --git a/bash_completion b/bash_completion
index 0f8de5b..428bc8a 100644
--- a/bash_completion
+++ b/bash_completion
@@ -567,6 +567,13 @@ _usergroup()
        fi
 }
 
+# This function completes on valid shells
+#
+_shells()
+{
+       COMPREPLY=( "${comprep...@]}" $( compgen -W '$( grep "^[[:space:]]*/" \
+                       /etc/shells 2>/dev/null )' -- $cur ) )
+}
 
 # Get real command.
 # - arg: $1  Command
@@ -2621,8 +2628,7 @@ _chsh()
        prev=${COMP_WORDS[COMP_CWORD-1]}
 
        if [ "$prev" = "-s" ]; then
-               COMPREPLY=( $( compgen -W '$( grep "^[[:space:]]*/" \
-                               /etc/shells 2>/dev/null )' -- $cur ) )
+               _shells
        else
                COMPREPLY=( $( compgen -u -- $cur ) )
        fi

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-commits

Reply via email to