[Bash-completion-commits] [SCM] bash-completion branch, master, updated. b7937bf2f0099b9cd35c65f38f5662f0a11cd938
Ville Skyttä
ville.skytta at iki.fi
Fri Nov 5 19:30:00 UTC 2010
The following commit has been merged in the master branch:
commit b7937bf2f0099b9cd35c65f38f5662f0a11cd938
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Fri Nov 5 21:28:27 2010 +0200
Simplify _screen_sessions(), use compgen -W, fixes partial completion.
diff --git a/completions/screen b/completions/screen
index 1dc7a59..952d976 100644
--- a/completions/screen
+++ b/completions/screen
@@ -3,16 +3,9 @@
have screen &&
_screen_sessions()
{
- local pattern
-
- if [ -n "$1" ]; then
- pattern=".*$1.*"
- else
- pattern=".*"
- fi
-
- COMPREPLY=( $( command screen -ls | sed -ne \
- 's|^['$'\t'']\{1,\}\('"$cur"'[0-9]\{1,\}\.[^'$'\t'']\{1,\}\)'"$pattern"'$|\1|p' ) )
+ COMPREPLY=( $( compgen -W "$( command screen -ls | sed -ne \
+ 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' )" \
+ -- "$cur" ) )
} &&
_screen()
{
--
bash-completion
More information about the Bash-completion-commits
mailing list