modprobe: fix params with multi-line descriptions
The command `modprobe -p nouveau` outputs: tv_norm:Default TV norm. Supported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J, hd480i, hd480p, hd576i, hd576p, hd720p, hd1080i. Default: PAL *NOTE* Ignored for cards with external TV encoders. (charp) tv_disable:Disable TV-out detection (int) ... This breaks module parameter auto-completion, so only suggest parameters which are not preceded by whitespace. Tested with kmod 17-1 on Arch Linux. Modified-By: Ville Skyttä <ville.skytta@iki.fi>
This commit is contained in:
parent
d238ab5445
commit
454f67a047
@ -74,7 +74,8 @@ _modprobe()
|
|||||||
elif [[ -n "$module" ]]; then
|
elif [[ -n "$module" ]]; then
|
||||||
# do module parameter completion
|
# do module parameter completion
|
||||||
COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \
|
COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \
|
||||||
-p "$module" 2>/dev/null | cut -d: -f1 )" -- "$cur" ) )
|
-p "$module" 2>/dev/null | \
|
||||||
|
awk -F: '!/^[ \t]/ { print $1 }' )" -- "$cur" ) )
|
||||||
else
|
else
|
||||||
_modules $version
|
_modules $version
|
||||||
if [[ $COMPREPLY ]]; then
|
if [[ $COMPREPLY ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user