]> code.delx.au - pulseaudio/blobdiff - shell-completion/pulseaudio-zsh-completion.zsh
zsh-completion: Add --monitor-stream completion to pacat
[pulseaudio] / shell-completion / pulseaudio-zsh-completion.zsh
index f9002ef3a529525c93f31868358e94b4f2d60e5d..abc443a4198fbb75616edadf90d818db0caad7ae 100644 (file)
@@ -24,18 +24,35 @@ _devices() {
         esac
 
     elif [[ $service == (pacat|paplay|parecord) ]]; then
-        if [[ $words == *-r[[:space:]]* ]]; then
-            cmd=('sources')
-        elif [[ $words == *-p[[:space:]]* ]]; then
-            cmd=('sinks')
-        else
-            cmd=('sinks' 'sources')
-        fi
+        case $words[$((CURRENT))] in
+            --device=*)
+                if [[ $words == *(--playback|-p)[[:space:]]* ||
+                    $service == paplay ]]; then
+                    cmd=('sinks')
+                elif [[ $words == *(--record|-r)[[:space:]]* ||
+                    $service == parecord ]]; then
+                    cmd=('sources')
+                else
+                    cmd=('sinks' 'sources')
+                fi
+                ;;
+            --monitor-stream=*) cmd=('sink-inputs');;
+        esac
+
+        case $words[$((CURRENT - 1))] in
+            -d)
+                if [[ $words == *(--playback|-p)[[:space:]]* ||
+                    $service == paplay ]]; then
+                    cmd=('sinks')
+                elif [[ $words == *(--record|-r)[[:space:]]* ||
+                    $service == parecord ]]; then
+                    cmd=('sources')
+                else
+                    cmd=('sinks' 'sources')
+                fi
+                ;;
+        esac
 
-    elif [[ $service == paplay ]]; then
-        cmd=('sinks')
-    elif [[ $service == parecord ]]; then
-        cmd=('sources')
     fi
 
     for (( i = 0; i < ${#words[@]}; i++ )) do
@@ -257,6 +274,8 @@ _pactl_completion() {
             'suspend-sink: suspend or resume a sink'
             'suspend-source: suspend or resume a source'
             'set-card-profile: set a card profile:cards:_cards'
+            'set-sink-default: set the default sink'
+            'set-source-default: set the default source'
             'set-sink-port: set the sink port of a sink'
             'set-source-port: set the source port of a source'
             'set-port-latency-offset: set a latency offset on a port'
@@ -313,7 +332,7 @@ _pactl_completion() {
         set-card-profile) _profiles;;
         set-(sink|source)-port) _ports;;
         set-port-latency-offset) _ports;;
-        set-*-mute) compadd true false;;
+        set-*-mute) compadd true false toggle;;
         suspend-*) compadd true false;;
         list) compadd short;;
         move-*) _devices;;
@@ -327,6 +346,7 @@ _pacmd_completion() {
         _pacmd_commands=(
             'help: show help and exit'
             'list-modules: list modules'
+            'list-cards: list cards'
             'list-sinks: list sinks'
             'list-sources: list sources'
             'list-clients: list clients'
@@ -449,6 +469,7 @@ _pacat_completion() {
         {-p,--playback}'[create a connection for playback]' \
         {-s,--server=}'[name of server to connect to]:host:_hosts' \
         {-d,--device=}'[name of sink/source to connect to]:device:_devices' \
+        '--monitor-stream=[index of the sink input to record from]:device:_devices' \
         {-n,--client-name=}'[client name to use]:name' \
         '--stream-name=[how to call this stream]:name' \
         '--volume=[initial volume to use]:volume' \
@@ -468,8 +489,9 @@ _pacat_completion() {
         '--property=[set the specified property]:property' \
         '--raw[record/play raw PCM data]' \
         '--passthrough[passtrough data]' \
-        '--file-format[record/play formatted PCM data]:format:_pacat_file_formats' \
+        '--file-format=[record/play formatted PCM data]:format:_pacat_file_formats' \
         '--list-file-formats[list available formats]' \
+        '::files:_files' \
 }
 
 # TODO log-target file completion