[pulseaudio-commits] 2 commits - shell-completion/pulseaudio-bash-completion.sh shell-completion/pulseaudio-zsh-completion.zsh
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Tue Oct 29 18:50:55 CET 2013
shell-completion/pulseaudio-bash-completion.sh | 8 ++++-
shell-completion/pulseaudio-zsh-completion.zsh | 38 +++++++++++++++++--------
2 files changed, 34 insertions(+), 12 deletions(-)
New commits:
commit b49298c51ee2fe45ea2556b749ad0952f7580e7c
Author: poljar (Damir JeliÄ) <poljarinho at gmail.com>
Date: Thu Aug 15 14:08:43 2013 +0200
zsh-completion: Fix pacat device completion
The pacat completion didn't complete the right devices for the --record
and --playback flags.
This patch fixes this and makes the device completion for pacat easily
expandable.
diff --git a/shell-completion/pulseaudio-zsh-completion.zsh b/shell-completion/pulseaudio-zsh-completion.zsh
index 142d031..e872736 100644
--- a/shell-completion/pulseaudio-zsh-completion.zsh
+++ b/shell-completion/pulseaudio-zsh-completion.zsh
@@ -24,18 +24,34 @@ _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
+ ;;
+ 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
commit 47729c43b4b0e59bac5858e66f851ad01aa44c68
Author: poljar (Damir JeliÄ) <poljarinho at gmail.com>
Date: Thu Aug 15 14:08:42 2013 +0200
bash-completion: Add --monitor-stream completion to pacat
diff --git a/shell-completion/pulseaudio-bash-completion.sh b/shell-completion/pulseaudio-bash-completion.sh
index d5b99db..43f4a2c 100644
--- a/shell-completion/pulseaudio-bash-completion.sh
+++ b/shell-completion/pulseaudio-bash-completion.sh
@@ -439,7 +439,7 @@ _pacat () {
--rate= --format= --channels= --channel-map= --fix-format --fix-rate
--fix-channels --no-remix --no-remap --latency= --process-time=
--latency-msec= --process-time-msec= --property= --raw --passthrough
- --file-format= --list-file-formats'
+ --file-format= --list-file-formats --monitor-stream='
_init_completion -n = || return
@@ -456,6 +456,12 @@ _pacat () {
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
+ --monitor-stream=*)
+ cur=${cur#*=}
+ comps=$(__sink_inputs)
+ COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
+ ;;
+
--rate=*)
cur=${cur#*=}
COMPREPLY=($(compgen -W '32000 44100 48000 9600 192000' -- "$cur"))
More information about the pulseaudio-commits
mailing list