1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-02 00:41:44 +02:00

12308: Andrej and pws: _man formats, again

This commit is contained in:
Peter Stephenson 2000-07-19 09:03:29 +00:00
parent 67f16de104
commit 6ce73cf6f5
2 changed files with 12 additions and 3 deletions

@ -1,3 +1,9 @@
2000-07-19 Peter Stephenson <pws@cambridgesiliconradio.com>
* 12308: Completion/User/_man: Andrej and pws: cope with systems
where manual pages just have bare .Z and no number; don't be
too clever about suffix until we try to strip it.
2000-07-18 Sven Wischnowsky <wischnow@zsh.org>
* 12297: Src/Zle/compcore.c: don't let duplicate matches keep us

@ -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)}%.<->*}