Add *.Z support to man completion.

This commit is contained in:
Ville Skyttä 2010-03-30 22:04:07 +03:00
parent d6068483d2
commit b8267d131e

View File

@ -7,7 +7,7 @@ _man()
{ {
local cur i prev sect manpath manext mansect uname local cur i prev sect manpath manext mansect uname
manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@([gx]z|bz2|lzma))" manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@([gx]z|bz2|lzma|Z))"
mansect="@([0-9lnp]|[0-9][px]|3pm)" mansect="@([0-9lnp]|[0-9][px]|3pm)"
COMPREPLY=() COMPREPLY=()
@ -54,7 +54,7 @@ _man()
# weed out directory path names and paths to man pages # weed out directory path names and paths to man pages
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
# strip suffix from man pages # strip suffix from man pages
COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma)} ) COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma|Z)} )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
if [[ "$prev" != $mansect ]]; then if [[ "$prev" != $mansect ]]; then