man: Add support for .lz man pages (RedHat: #839310).

This commit is contained in:
Ville Skyttä 2012-07-11 18:15:10 +03:00
parent e2e64a1632
commit c9ed16694d

View File

@ -8,9 +8,10 @@ _man()
local cur prev words cword split
_init_completion -s -n : || return
local sect manpath manext mansect
local sect manpath manext mansect comprsuffix
manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?(.@([gx]z|bz2|lzma|Z))"
comprsuffix=".@([glx]z|bz2|lzma|Z)"
manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)"
mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))"
case $prev in
@ -82,7 +83,7 @@ _man()
# weed out directory path names and paths to man pages
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
# strip suffix from man pages
COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma|Z)} )
COMPREPLY=( ${COMPREPLY[@]%$comprsuffix} )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
if [[ "$prev" != $mansect ]]; then