From c9ed16694da974ce9faa3f49a274c7c6cfb4abc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 11 Jul 2012 18:15:10 +0300 Subject: [PATCH] man: Add support for .lz man pages (RedHat: #839310). --- completions/man | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/completions/man b/completions/man index 0c3769d5..6e7aa75e 100644 --- a/completions/man +++ b/completions/man @@ -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