[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-124-g976ba44

Ville Skyttä ville.skytta at iki.fi
Mon Apr 25 12:53:41 UTC 2011


The following commit has been merged in the master branch:
commit c5b771749bd11bfaa31877136b896fd6cb0e5ee0
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Apr 25 15:19:48 2011 +0300

    Add _terms() and screen -T completion.

diff --git a/CHANGES b/CHANGES
index dcbe167..d720a45 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,8 +2,8 @@ bash-completion (2.x)
 
   [ Ville Skyttä ]
   * Add pxz and reptyr completions.
-  * Improve aspell, gendiff, rsync, smartctl, tar, xz, xzdec, and generic long
-    option completions.
+  * Improve aspell, gendiff, rsync, screen, smartctl, tar, xz, xzdec, and
+    generic long option completions.
   * Try harder to find the correct perl executable to run the perl helper with.
   * Drop rpm query support for rpm < 4.1.
   * Split rpm and rpmbuild completions and improve them both.
diff --git a/bash_completion b/bash_completion
index 44e8ed6..fe01ac2 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1227,6 +1227,16 @@ _dvd_devices()
     COMPREPLY+=( $( compgen -f -d -X "!*/?(r)dvd*" -- "${cur:-/dev/}" ) )
 }
 
+# TERM environment variable values
+_terms()
+{
+    COMPREPLY+=( $( compgen -W \
+        "$( sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap \
+            2>/dev/null )" -- "$cur" ) )
+    COMPREPLY+=( $( compgen -W "$( { toe -a 2>/dev/null || toe 2>/dev/null; } \
+        | awk '{ print $1 }' | sort -u )" -- "$cur" ) )
+}
+
 # a little help for FreeBSD ports users
 [ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \
     patch configure build install reinstall deinstall clean clean-depends \
diff --git a/completions/screen b/completions/screen
index e2d99bd..7c405c3 100644
--- a/completions/screen
+++ b/completions/screen
@@ -46,11 +46,15 @@ _screen()
             _filedir
             return 0
             ;;
+        -T)
+            _terms
+            return 0
+            ;;
     esac
 
     if [[ "$cur" == -* ]]; then
         COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln \
-            -list -L -m -O -p -q -r -R -s -S -t -U -v -wipe -x -X --help \
+            -list -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help \
             --version' -- "$cur" ) )
     fi
 } &&

-- 
bash-completion



More information about the Bash-completion-commits mailing list