Add _terms() and screen -T completion.

This commit is contained in:
Ville Skyttä 2011-04-25 15:19:48 +03:00
parent 3750aea95e
commit c5b771749b
3 changed files with 17 additions and 3 deletions

View File

@ -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.

View File

@ -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 \

View File

@ -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
} &&