Fix awk error in "modprobe -r /" completion, extract/use _installed_modules for rmmod and modprobe -r.
This commit is contained in:
parent
134614341c
commit
6a2ff139a0
@ -485,6 +485,14 @@ _modules()
|
|||||||
sed -ne 's/^\('$cur'.*\)\.k\?o\(\|.gz\)$/\1/p') )
|
sed -ne 's/^\('$cur'.*\)\.k\?o\(\|.gz\)$/\1/p') )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This function completes on installed modules
|
||||||
|
#
|
||||||
|
_installed_modules()
|
||||||
|
{
|
||||||
|
COMPREPLY=( $( compgen -W "$( /sbin/lsmod | \
|
||||||
|
awk '{if (NR != 1) print $1}' )" -- $1 ) )
|
||||||
|
}
|
||||||
|
|
||||||
# This function completes on user:group format
|
# This function completes on user:group format
|
||||||
#
|
#
|
||||||
_usergroup()
|
_usergroup()
|
||||||
@ -817,8 +825,7 @@ _rmmod()
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur=`_get_cword`
|
cur=`_get_cword`
|
||||||
|
|
||||||
COMPREPLY=( $( /sbin/lsmod | \
|
_installed_modules "$cur"
|
||||||
awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' 2>/dev/null ))
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
complete -F _rmmod rmmod
|
complete -F _rmmod rmmod
|
||||||
@ -838,8 +845,7 @@ _insmod()
|
|||||||
# behave like lsmod for modprobe -r
|
# behave like lsmod for modprobe -r
|
||||||
if [ $1 = "modprobe" ] &&
|
if [ $1 = "modprobe" ] &&
|
||||||
[ "${COMP_WORDS[1]}" = "-r" ]; then
|
[ "${COMP_WORDS[1]}" = "-r" ]; then
|
||||||
COMPREPLY=( $( /sbin/lsmod | \
|
_installed_modules "$cur"
|
||||||
awk '{if (NR != 1 && $1 ~ /^'$cur'/) print $1}' ) )
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -101,6 +101,7 @@ bash-completion (200811xx) UNRELEASED; urgency=low
|
|||||||
* Added lzop completion.
|
* Added lzop completion.
|
||||||
* Fix scp metacharacter escaping.
|
* Fix scp metacharacter escaping.
|
||||||
* Remove duplicate cpio completion, thanks to Freddy Vulto (Closes: #512823)
|
* Remove duplicate cpio completion, thanks to Freddy Vulto (Closes: #512823)
|
||||||
|
* Fix awk error in "modprobe -r /" completion (Closes: #512556).
|
||||||
|
|
||||||
-- David Paleino <d.paleino@gmail.com> Sat, 17 Jan 2009 19:01:16 +0100
|
-- David Paleino <d.paleino@gmail.com> Sat, 17 Jan 2009 19:01:16 +0100
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user