_man(): check for /etc/manpath.config as well as /etc/man.config, since
Debian uses the former
This commit is contained in:
parent
acb9c52558
commit
93f113e34d
@ -1,6 +1,6 @@
|
|||||||
# bash_completion - some programmable completion functions for bash 2.05a
|
# bash_completion - some programmable completion functions for bash 2.05a
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.112 2002/02/13 19:25:22 ianmacd Exp $
|
# $Id: bash_completion,v 1.113 2002/02/14 17:49:43 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -283,7 +283,7 @@ _insmod()
|
|||||||
[ $OS = Linux ] &&
|
[ $OS = Linux ] &&
|
||||||
_man()
|
_man()
|
||||||
{
|
{
|
||||||
local cur prev cmd sect
|
local cur prev cmd sect config i
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
@ -293,8 +293,11 @@ _man()
|
|||||||
|
|
||||||
# default completion if parameter contains /
|
# default completion if parameter contains /
|
||||||
[[ "$cur" == */* ]] && return 0
|
[[ "$cur" == */* ]] && return 0
|
||||||
# default to command completion if no man.config
|
# default to command completion if no man config file
|
||||||
if [ ! -r /etc/man.config ]; then
|
for i in /etc/man{,path}.config; do
|
||||||
|
[ -r $i ] && config=$i
|
||||||
|
done
|
||||||
|
if [ -z "$config" ]; then
|
||||||
COMPREPLY=( $( compgen -c $cur ) )
|
COMPREPLY=( $( compgen -c $cur ) )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user