Add *.xz support to man completion.

This commit is contained in:
Ville Skyttä 2010-03-30 22:02:25 +03:00
parent 6e373da8e1
commit d6068483d2
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ bash-completion (2.x)
* Apply pine completion to alpine too. * Apply pine completion to alpine too.
* Remove many unnecessary short option completions where long ones exist. * Remove many unnecessary short option completions where long ones exist.
* Improve chsh, chgrp, chown, configure, cvs, gkrellm, gzip, lftp, look, * Improve chsh, chgrp, chown, configure, cvs, gkrellm, gzip, lftp, look,
make, mdadm, modprobe, mplayer, mysqladmin, perldoc, rsync, screen, make, man, mdadm, modprobe, mplayer, mysqladmin, perldoc, rsync, screen,
service, scp, ssh, sshfs, update-alternatives, vncviewer, yp-tools, and service, scp, ssh, sshfs, update-alternatives, vncviewer, yp-tools, and
general hostname completions. general hostname completions.
* Add abook and wtf completion, based on work by Raphaël Droz. * Add abook and wtf completion, based on work by Raphaël Droz.

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)?(.@(gz|bz2|lzma))" manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@([gx]z|bz2|lzma))"
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[@]%.@(gz|bz2|lzma)} ) COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma)} )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
if [[ "$prev" != $mansect ]]; then if [[ "$prev" != $mansect ]]; then