[Bash-completion-commits] [bash-completion] 02/03: *: Invoke command to be completed, not its basename

Ville Skyttä scop-guest at moszumanska.debian.org
Sun Nov 16 10:26:56 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 7d3de619d1d84cba29597a54b4f0c0b786e8abe0
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Nov 16 12:18:41 2014 +0200

    *: Invoke command to be completed, not its basename
---
 completions/7z         | 2 +-
 completions/abook      | 4 ++--
 completions/brctl      | 2 +-
 completions/cvsps      | 8 ++++----
 completions/getent     | 4 ++--
 completions/gpg        | 6 +++---
 completions/gpg2       | 6 +++---
 completions/gphoto2    | 6 +++---
 completions/ipv6calc   | 2 +-
 completions/mcrypt     | 8 ++++----
 completions/medusa     | 2 +-
 completions/mount      | 2 +-
 completions/msynctool  | 8 ++++----
 completions/openssl    | 2 +-
 completions/pkg-config | 2 +-
 completions/qemu       | 8 ++++----
 completions/rfkill     | 2 +-
 completions/svk        | 4 ++--
 completions/xfreerdp   | 2 +-
 19 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/completions/7z b/completions/7z
index f78c282..4cef2f2 100644
--- a/completions/7z
+++ b/completions/7z
@@ -105,7 +105,7 @@ _7z()
     else
         if [[ ${words[1]} == d ]]; then
             local IFS=$'\n'
-            COMPREPLY=( $( compgen -W "$( printf '%s\n' $( 7z l ${words[2]} \
+            COMPREPLY=( $( compgen -W "$( printf '%s\n' $( $1 l ${words[2]} \
                 -slt 2>/dev/null | sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \
                 2>/dev/null | tail -n+2 ) )" -- "$cur" ) )
             compopt -o filenames
diff --git a/completions/abook b/completions/abook
index 1a6f0a0..826b579 100644
--- a/completions/abook
+++ b/completions/abook
@@ -22,12 +22,12 @@ _abook()
 
     case $prev in
         --informat)
-            COMPREPLY=( $( compgen -W "$(abook --formats | \
+            COMPREPLY=( $( compgen -W "$($1 --formats | \
                 sed -n -e 's/^'$'\t''\([a-z]*\).*/\1/p' -e '/^$/q')" -- "$cur" ) )
             return 0
             ;;
         --outformat)
-            COMPREPLY=( $( compgen -W "$(abook --formats | \
+            COMPREPLY=( $( compgen -W "$($1 --formats | \
                 sed -n -e '/^$/,$s/^'$'\t''\([a-z]*\).*/\1/p')" -- "$cur" ) )
             return 0
             ;;
diff --git a/completions/brctl b/completions/brctl
index 2720715..10d9044 100644
--- a/completions/brctl
+++ b/completions/brctl
@@ -18,7 +18,7 @@ _brctl()
                 show)
                     ;;
                 *)
-                    COMPREPLY=( $( compgen -W "$(brctl show | \
+                    COMPREPLY=( $( compgen -W "$($1 show | \
                         awk 'NR>1 {print $1}' )" -- "$cur" ) )
             esac
             ;;
diff --git a/completions/cvsps b/completions/cvsps
index 8b986f5..be36ab4 100644
--- a/completions/cvsps
+++ b/completions/cvsps
@@ -10,22 +10,22 @@ _cvsps()
             return 0
             ;;
         -s)
-            COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
+            COMPREPLY=( $( compgen -W "$( $1 2>/dev/null |
                 awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) )
             return 0
             ;;
         -a)
-            COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
+            COMPREPLY=( $( compgen -W "$( $1 2>/dev/null |
                 awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) )
             return 0
             ;;
         -b)
-            COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
+            COMPREPLY=( $( compgen -W "$( $1 2>/dev/null |
                 awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) )
             return 0
             ;;
         -r)
-            COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
+            COMPREPLY=( $( compgen -W "$( $1 2>/dev/null |
                 awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) )
             return 0
             ;;
diff --git a/completions/getent b/completions/getent
index 52f1ba4..954bebf 100644
--- a/completions/getent
+++ b/completions/getent
@@ -42,12 +42,12 @@ _getent()
             return 0
             ;;
         protocols|networks|ahosts|ahostsv4|ahostsv6|rpc)
-            COMPREPLY=( $( compgen -W "$( getent $db | \
+            COMPREPLY=( $( compgen -W "$( $1 $db | \
                 awk '{ print $1 }' )" -- "$cur" ) )
             return 0
             ;;
         aliases|shadow|gshadow)
-            COMPREPLY=( $( compgen -W "$( getent $db | cut -d: -f1 )" \
+            COMPREPLY=( $( compgen -W "$( $1 $db | cut -d: -f1 )" \
                 -- "$cur" ) )
             return 0
             ;;
diff --git a/completions/gpg b/completions/gpg
index 91436f7..9a79167 100644
--- a/completions/gpg
+++ b/completions/gpg
@@ -12,13 +12,13 @@ _gpg()
             ;;
         --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key)
             # return list of public keys
-            COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
+            COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \
                 sed -ne 's@^pub.*/\([^ ]*\).*$@\1 at p' \
                     -ne 's@^.*\(<\([^>]*\)>\).*$@\2 at p' )" -- "$cur" ) )
             return 0
             ;;
         -r|--recipient)
-            COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
+            COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \
                 sed -ne 's@^.*<\([^>]*\)>.*$@\1 at p')" -- "$cur" ) )
             if [[ -e ~/.gnupg/gpg.conf ]]; then
                 COMPREPLY+=( $( compgen -W "$( sed -ne \
@@ -30,7 +30,7 @@ _gpg()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '$(gpg --dump-options)' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) )
     fi
 } &&
 complete -F _gpg -o default gpg
diff --git a/completions/gpg2 b/completions/gpg2
index 3efc2db..8db8788 100644
--- a/completions/gpg2
+++ b/completions/gpg2
@@ -16,13 +16,13 @@ _gpg2()
             ;;
         --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key)
             # return list of public keys
-            COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
+            COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \
                 sed -ne 's@^pub.*/\([^ ]*\).*$@\1 at p' \
                     -ne 's@^.*\(<\([^>]*\)>\).*$@\2 at p' )" -- "$cur" ) )
             return 0
             ;;
         -r|--recipient)
-            COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
+            COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \
                 sed -ne 's@^.*<\([^>]*\)>.*$@\1 at p')" -- "$cur" ) )
             if [[ -e ~/.gnupg/gpg.conf ]]; then
                 COMPREPLY+=( $( compgen -W "$( sed -ne \
@@ -34,7 +34,7 @@ _gpg2()
     esac
 
     if [[ "$cur" == -* ]]; then
-        COMPREPLY=( $( compgen -W '$(gpg2 --dump-options)' -- "$cur" ) )
+        COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) )
     fi
 } &&
 complete -F _gpg2 -o default gpg2
diff --git a/completions/gphoto2 b/completions/gphoto2
index cc2ce5e..88b28da 100644
--- a/completions/gphoto2
+++ b/completions/gphoto2
@@ -23,19 +23,19 @@ _gphoto2()
             return 0
             ;;
         --port)
-            COMPREPLY=( $(compgen -W "$( gphoto2 --list-ports 2>/dev/null | \
+            COMPREPLY=( $(compgen -W "$( $1 --list-ports 2>/dev/null | \
                 tail -n +4 | awk '{ print $1 }'  )" -- "$cur") )
             __ltrim_colon_completions "$cur"
             return 0
             ;;
         --camera)
             local IFS=$'\n'
-            COMPREPLY=( $(compgen -W "$( gphoto2 --list-cameras 2>/dev/null | \
+            COMPREPLY=( $(compgen -W "$( $1 --list-cameras 2>/dev/null | \
                 tail -n +3 | awk -F'"' '{ print $2 }'  )" -- "$cur") )
             return 0
             ;;
         --get-config|--set-config|--set-config-index|--set-config-value)
-            COMPREPLY=( $(compgen -W "$( gphoto2 --list-config 2>/dev/null \
+            COMPREPLY=( $(compgen -W "$( $1 --list-config 2>/dev/null \
                 )" -- "$cur") )
             return 0
             ;;
diff --git a/completions/ipv6calc b/completions/ipv6calc
index 5db7271..ec7ac09 100644
--- a/completions/ipv6calc
+++ b/completions/ipv6calc
@@ -11,7 +11,7 @@ _ipv6calc()
             ;;
         -I|--in|-O|--out|-A|--action)
             # With ipv6calc < 0.73.0, -m does nothing here, so use sed instead.
-            COMPREPLY=( $( compgen -W "$( ipv6calc "$prev" -h 2>&1 | \
+            COMPREPLY=( $( compgen -W "$( $1 "$prev" -h 2>&1 | \
                 sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \
                 -- "$cur" ) )
             return 0
diff --git a/completions/mcrypt b/completions/mcrypt
index 8c7d189..90cc17f 100644
--- a/completions/mcrypt
+++ b/completions/mcrypt
@@ -12,23 +12,23 @@ _mcrypt()
             return 0
             ;;
         -o|--keymode)
-            COMPREPLY=( $( compgen -W '$( mcrypt --list-keymodes \
+            COMPREPLY=( $( compgen -W '$( $1 --list-keymodes \
                 2>/dev/null )' -- "$cur" ) )
             return 0
             ;;
         -m|--mode)
-            COMPREPLY=( $( compgen -W "$( mcrypt --list \
+            COMPREPLY=( $( compgen -W "$( $1 --list \
                 2>/dev/null | sed -e 's/.*: //' -e 's/ $//' | \
                 sort -u )" -- "$cur" ) )
             return 0
             ;;
         -a|--algorithm)
-            COMPREPLY=( $( compgen -W "$( mcrypt --list 2>/dev/null | \
+            COMPREPLY=( $( compgen -W "$( $1 --list 2>/dev/null | \
                 awk '{print $1}' )" -- "$cur" ) )
             return 0
             ;;
         -h|--hash)
-            COMPREPLY=( $( compgen -W '$( mcrypt --list-hash 2>/dev/null | \
+            COMPREPLY=( $( compgen -W '$( $1 --list-hash 2>/dev/null | \
                 sed -e 1d )' -- "$cur" ) )
             return 0
             ;;
diff --git a/completions/medusa b/completions/medusa
index 84a0381..ba1ac97 100644
--- a/completions/medusa
+++ b/completions/medusa
@@ -15,7 +15,7 @@ _medusa()
             return 0
             ;;
         -M)
-            COMPREPLY=( $( compgen -W "$(medusa -d | awk '/^ +\+/ {print $2}' \
+            COMPREPLY=( $( compgen -W "$($1 -d | awk '/^ +\+/ {print $2}' \
                 | sed -e 's/\.mod$//')" ) )
             return 0
             ;;
diff --git a/completions/mount b/completions/mount
index 6818ac3..370f43d 100644
--- a/completions/mount
+++ b/completions/mount
@@ -51,7 +51,7 @@ _mount()
         COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab )" -- "$cur" ) )
     elif [[ ! -e /etc/fstab ]]; then
         # probably Cygwin
-        COMPREPLY=( $( compgen -W "$( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) )
+        COMPREPLY=( $( compgen -W "$( $1 | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) )
     else
         # probably BSD
         COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab )" -- "$cur" ) )
diff --git a/completions/msynctool b/completions/msynctool
index 28a0163..980378c 100644
--- a/completions/msynctool
+++ b/completions/msynctool
@@ -7,13 +7,13 @@ _msynctool()
 
     case $words in
         --configure)
-            COMPREPLY=( $( compgen -W "$(msynctool --showgroup \
+            COMPREPLY=( $( compgen -W "$($1 --showgroup \
                 $prev | awk '/^Member/ {print $2}' | sed \
                 -e 's/:$//' )" -- "$cur" ) )
             return 0
             ;;
         --addmember)
-            COMPREPLY=( $( compgen -W '$(msynctool --listplugins \
+            COMPREPLY=( $( compgen -W '$($1 --listplugins \
                 | sed -e '1d' )' -- "$cur" ) )
             return 0
             ;;
@@ -21,12 +21,12 @@ _msynctool()
 
     case $prev in
         --configure|--addgroup|--delgroup|--showgroup|--sync|--addmember)
-            COMPREPLY=( $( compgen -W '$(msynctool --listgroups \
+            COMPREPLY=( $( compgen -W '$($1 --listgroups \
                 | sed -e '1d' )' -- "$cur" ) )
             return 0
             ;;
         --showformats|--filter-objtype|--slow-sync)
-            COMPREPLY=( $( compgen -W '$(msynctool --listobjects \
+            COMPREPLY=( $( compgen -W '$($1 --listobjects \
                 | sed -e '1d' )' -- "$cur" ) )
             return 0
             ;;
diff --git a/completions/openssl b/completions/openssl
index 997fe1e..2afc346 100644
--- a/completions/openssl
+++ b/completions/openssl
@@ -89,7 +89,7 @@ _openssl()
                 return 0
                 ;;
             -cipher)
-                COMPREPLY=( $( IFS=: compgen -W "$( openssl ciphers )" \
+                COMPREPLY=( $( IFS=: compgen -W "$( $1 ciphers )" \
                     -- "$cur" ) )
                 return 0
                 ;;
diff --git a/completions/pkg-config b/completions/pkg-config
index f861c30..c2a94fe 100644
--- a/completions/pkg-config
+++ b/completions/pkg-config
@@ -35,7 +35,7 @@ _pkg_config()
         COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
         [[ $COMPREPLY == *= ]] && compopt -o nospace
     else
-        COMPREPLY=( $( compgen -W "$( pkg-config --list-all \
+        COMPREPLY=( $( compgen -W "$( $1 --list-all \
             2>/dev/null | awk '{print $1}' )" -- "$cur" ) )
     fi
 } &&
diff --git a/completions/qemu b/completions/qemu
index 377df89..c1544bf 100644
--- a/completions/qemu
+++ b/completions/qemu
@@ -26,17 +26,17 @@ _qemu()
             return 0
             ;;
         -soundhw)
-            COMPREPLY=( $( compgen -W "$( qemu -soundhw ? | awk \
+            COMPREPLY=( $( compgen -W "$( $1 -soundhw ? | awk \
                 '/^[[:lower:]]/ {print $1}' ) all" -- "$cur" ) )
             return 0
             ;;
         -M)
-            COMPREPLY=( $( compgen -W "$( qemu -M ? | awk \
+            COMPREPLY=( $( compgen -W "$( $1 -M ? | awk \
                 '/^[[:lower:]]/ {print $1}' )" -- "$cur" ) )
             return 0
             ;;
         -cpu)
-            COMPREPLY=( $( compgen -W "$( qemu -cpu ? | awk \
+            COMPREPLY=( $( compgen -W "$( $1 -cpu ? | awk \
                 '{print $2}' )" -- "$cur" ) )
             return 0
             ;;
@@ -82,7 +82,7 @@ _qemu()
             return 0
             ;;
         -watchdog)
-            COMPREPLY=( $( compgen -W "$( qemu -watchdog ? 2>&1 | \
+            COMPREPLY=( $( compgen -W "$( $1 -watchdog ? 2>&1 | \
                 awk '{print $1}' )" -- "$cur" ) )
             return 0
             ;;
diff --git a/completions/rfkill b/completions/rfkill
index 305f19d..582441b 100644
--- a/completions/rfkill
+++ b/completions/rfkill
@@ -15,7 +15,7 @@ _rfkill()
                 ;;
             2)
                 if [[ $prev == block || $prev == unblock ]]; then
-                    COMPREPLY=( $( compgen -W "$(rfkill list | awk -F: \
+                    COMPREPLY=( $( compgen -W "$($1 list | awk -F: \
                         '/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \
                         wwan gps" -- "$cur" ) )
                 fi
diff --git a/completions/svk b/completions/svk
index 632eeb2..d82e153 100644
--- a/completions/svk
+++ b/completions/svk
@@ -191,7 +191,7 @@ _svk()
                         --delete' -- "$cur" ) )
                     ;;
                 sync)
-                    COMPREPLY=( $( compgen -W "$( svk mirror --list \
+                    COMPREPLY=( $( compgen -W "$( $1 mirror --list \
                         2>/dev/null | awk '/^\//{print $1}' )" -- "$cur" ) )
                     ;;
                 co|checkout|push|pull)
@@ -200,7 +200,7 @@ _svk()
                     else
                         path=//
                     fi
-                    COMPREPLY=( $( compgen -W "$( svk list $path 2>/dev/null | \
+                    COMPREPLY=( $( compgen -W "$( $1 list $path 2>/dev/null | \
                         sed -e 's|\(.*\)|'$path'\1|')" -- "$cur" ) )
                     ;;
                 *)
diff --git a/completions/xfreerdp b/completions/xfreerdp
index fda531b..21bb183 100644
--- a/completions/xfreerdp
+++ b/completions/xfreerdp
@@ -7,7 +7,7 @@ _xfreerdp()
 
     case $prev in
         -k)
-            COMPREPLY=( $( compgen -W "$(xfreerdp --kbd-list | \
+            COMPREPLY=( $( compgen -W "$($1 --kbd-list | \
 		    awk '/^0x/ {print $1}')" -- "$cur" ) )
             return 0
             ;;

-- 
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