insmod, modprobe: Don't hardcode path to modinfo (Alioth: #313569)
parent
a062777d4b
commit
199a63bd4d
|
@ -9,8 +9,8 @@ _insmod()
|
|||
if [[ $cword -eq 1 ]]; then
|
||||
_filedir '@(?(k)o?(.gz))'
|
||||
else # do module parameter completion
|
||||
COMPREPLY=( $( compgen -W "$( /sbin/modinfo -p ${words[1]} \
|
||||
2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \
|
||||
-p ${words[1]} 2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _insmod insmod insmod.static
|
||||
|
|
|
@ -73,8 +73,8 @@ _modprobe()
|
|||
_filedir '@(?(k)o?(.gz))'
|
||||
elif [[ -n "$module" ]]; then
|
||||
# do module parameter completion
|
||||
COMPREPLY=( $( compgen -W "$( /sbin/modinfo -p "$module" \
|
||||
2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \
|
||||
-p "$module" 2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
|
||||
else
|
||||
_modules $version
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue