diff --git a/completions/7z b/completions/7z index f78c2821..4cef2f2d 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 1a6f0a0c..826b579d 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 27207158..10d90443 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 8b986f57..be36ab4c 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 52f1ba4d..954bebf0 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 91436f7a..9a79167d 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@p' \ -ne 's@^.*\(<\([^>]*\)>\).*$@\2@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@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 3efc2dbb..8db87886 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@p' \ -ne 's@^.*\(<\([^>]*\)>\).*$@\2@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@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 cc2ce5e1..88b28da2 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 5db7271f..ec7ac09a 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 8c7d189c..90cc17f5 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 84a03813..ba1ac974 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 6818ac39..370f43da 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 28a0163a..980378c1 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 997fe1ec..2afc3460 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 f861c30e..c2a94fe5 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 377df89f..c1544bff 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 305f19d1..582441bb 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 632eeb29..d82e1539 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 fda531bb..21bb1834 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 ;;