]> code.delx.au - pulseaudio/blobdiff - shell-completion/pulseaudio-bash-completion.sh
bash-completion: Fix device completion for pacat
[pulseaudio] / shell-completion / pulseaudio-bash-completion.sh
index 686178eeac94a00e183fb67bfc39cad1acddb437..d5b99db0d7ad7e635f4b86a34c44ec764c978715 100644 (file)
@@ -174,6 +174,7 @@ _pactl() {
             _known_hosts_real "$cur"
             ;;
     esac
+    [[ $COMPREPLY ]] && return 0
 
     case $prev in
         list) COMPREPLY=($(compgen -W '${list_types[*]}' -- "$cur")) ;;
@@ -234,6 +235,7 @@ _pactl() {
         -s)
             _known_hosts_real "$cur" ;;
     esac
+    [[ $COMPREPLY ]] && return 0
 
     case $cur in
         --server=*)
@@ -257,7 +259,7 @@ _pacmd() {
     local cur prev words cword preprev command
     local comps
     local flags='-h --help --version'
-    local commands=(exit help list-modules list-sinks list-sources list-clients
+    local commands=(exit help list-modules list-cards list-sinks list-sources list-clients
                     list-samples list-sink-inputs list-source-outputs stat info
                     load-module unload-module describe-module set-sink-volume
                     set-source-volume set-sink-input-volume set-source-output-volume
@@ -316,6 +318,7 @@ _pacmd() {
     esac
 
     case $prev in
+        list-*) ;;
         describe-module|load-module)
             comps=$(__all_modules)
             COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
@@ -449,7 +452,7 @@ _pacat () {
         --device=*)
             cur=${cur#*=}
             comps=$(__sinks)
-            comps+=$(__sources)
+            comps+=" "$(__sources)
             COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
             ;;
 
@@ -478,7 +481,7 @@ _pacat () {
         -s) _known_hosts_real "$cur" ;;
         -d)
             comps=$(__sinks)
-            comps+=$(__sources)
+            comps+=" "$(__sources)
             COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
             ;;
     esac