[Bash-completion-commits] [bash-completion] 01/02: modprobe: fix params with multi-line descriptions

Ville Skyttä scop-guest at moszumanska.debian.org
Mon Jun 9 06:40:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

scop-guest pushed a commit to branch master
in repository bash-completion.

commit 454f67a0478e2097e765169191151e9cf83fe978
Author: Peter Wu <peter at lekensteyn.nl>
Date:   Sun Jun 8 12:55:01 2014 +0200

    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 at iki.fi>
---
 completions/modprobe | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/completions/modprobe b/completions/modprobe
index 4bc3ebc..10a4a1b 100644
--- a/completions/modprobe
+++ b/completions/modprobe
@@ -74,7 +74,8 @@ _modprobe()
             elif [[ -n "$module" ]]; then
                 # do module parameter completion
                 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
                 _modules $version
                 if [[ $COMPREPLY ]]; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list