From 6ce73cf6f5b20598af72a492ea2e0736f880d869 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 19 Jul 2000 09:03:29 +0000 Subject: 12308: Andrej and pws: _man formats, again --- Completion/User/_man | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Completion') diff --git a/Completion/User/_man b/Completion/User/_man index 68ec12679..2dae425ee 100644 --- a/Completion/User/_man +++ b/Completion/User/_man @@ -30,13 +30,16 @@ fi mrd=(${^manpath/\%L/${LANG:-En_US.ASCII}}/mandb(N)) if [[ $words[2] = (<->*|1M|l|n) ]]; then rep=( - $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) ) + $manpath/(sman|man|cat)${words[2]}/${~approx}$PREFIX${~star}$SUFFIX.*(N:t) ) (($#mrd)) && rep[$#rep+1]=($(awk "\$2 == \"$words[2]\" {print \$1}" $mrd)) else - rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.<->*(N:t) ) + rep=( $manpath/(sman|man|cat)*/${~approx}$PREFIX${~star}$SUFFIX.*(N:t) ) (($#mrd)) && rep[$#rep+1]=($(awk '{print $1}' $mrd)) fi +# Remove any compression suffix, then remove the minimum possible string +# beginning with .<->: that handles problem cases like files called +# `POSIX.1.5'. (( $#rep )) && _wanted manuals expl 'manual page' \ - compadd - ${rep%%.[^.]##(.gz|.bz2|)} + compadd - ${${rep%%.(bz2|z|gz|Z)}%.<->*} -- cgit 1.4.1