[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-342-gd0c4f5d
Ville Skyttä
ville.skytta at iki.fi
Sat Jun 4 17:23:48 UTC 2011
The following commit has been merged in the master branch:
commit d0c4f5ddd2e0853c2ac384069c230f8efa2e1523
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Jun 4 19:58:52 2011 +0300
_shells: Rewrite in plain bash instead of using grep.
diff --git a/bash_completion b/bash_completion
index ddb2fec..92a48c8 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1142,9 +1142,10 @@ _allowed_groups()
#
_shells()
{
- COMPREPLY+=( $( compgen -W \
- '$( command grep "^[[:space:]]*/" /etc/shells 2>/dev/null )' \
- -- "$cur" ) )
+ local shell rest
+ while read -r shell rest; do
+ [[ $shell == /* && $shell == "$cur"* ]] && COMPREPLY+=( $shell )
+ done 2>/dev/null < /etc/shells
}
# This function completes on valid filesystem types
--
bash-completion
More information about the Bash-completion-commits
mailing list