insmod completion was not completing module parameters correctly
man completion now resorts to filename completion if no /etc/man.config
This commit is contained in:
parent
8cb465d393
commit
b9b7d9675d
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# <![CDATA[
|
# <![CDATA[
|
||||||
#
|
#
|
||||||
# $Id: bash_completion,v 1.13 2001/01/11 00:09:48 ianmacd Exp $
|
# $Id: bash_completion,v 1.14 2001/01/31 23:30:49 ianmacd Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||||
#
|
#
|
||||||
@ -200,7 +200,7 @@ _rmmod()
|
|||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
|
||||||
COMPREPLY=( $( /sbin/lsmod | \
|
COMPREPLY=( $( /sbin/lsmod | \
|
||||||
awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}') )
|
awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' ) )
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
complete -F _rmmod rmmod
|
complete -F _rmmod rmmod
|
||||||
@ -218,14 +218,15 @@ _insmod()
|
|||||||
modpath=/lib/modules/`uname -r`
|
modpath=/lib/modules/`uname -r`
|
||||||
|
|
||||||
if [ $COMP_CWORD -gt 1 ]; then
|
if [ $COMP_CWORD -gt 1 ]; then
|
||||||
COMPREPLY=( $( /sbin/modinfo -p $prev | cut -f 1 -d ' ' ) )
|
COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} | \
|
||||||
|
awk '{if ($1 ~ /^'$cur'/) print $1}' ) )
|
||||||
else
|
else
|
||||||
COMPREPLY=($( ls -R $modpath | sed -ne 's/^\('$cur'.*\)\.o$/\1/p'))
|
COMPREPLY=( $( ls -R $modpath | sed -ne 's/^\('$cur'.*\)\.o$/\1/p') )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
complete -F _insmod insmod modprobe modinfo
|
complete -F _insmod insmod modprobe
|
||||||
|
|
||||||
# man(1) completion. This relies on the security enhanced version of
|
# man(1) completion. This relies on the security enhanced version of
|
||||||
# GNU locate(1). UNIX variants having non-numeric man page sections
|
# GNU locate(1). UNIX variants having non-numeric man page sections
|
||||||
@ -245,8 +246,8 @@ _man()
|
|||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||||
|
|
||||||
# filename completion if parameter contains /
|
# filename completion if parameter contains / or we have no man.config
|
||||||
if [[ "$cur" == /* ]]; then
|
if [[ "$cur" == /* ]] || [ ! -f /etc/man.config ]; then
|
||||||
COMPREPLY=( $( compgen -f $cur ) )
|
COMPREPLY=( $( compgen -f $cur ) )
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user