mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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.
This commit is contained in:
parent
47729c43b4
commit
b49298c51e
1 changed files with 27 additions and 11 deletions
|
|
@ -24,18 +24,34 @@ _devices() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
elif [[ $service == (pacat|paplay|parecord) ]]; then
|
elif [[ $service == (pacat|paplay|parecord) ]]; then
|
||||||
if [[ $words == *-r[[:space:]]* ]]; then
|
case $words[$((CURRENT))] in
|
||||||
cmd=('sources')
|
--device=*)
|
||||||
elif [[ $words == *-p[[:space:]]* ]]; then
|
if [[ $words == *(--playback|-p)[[:space:]]* ||
|
||||||
cmd=('sinks')
|
$service == paplay ]]; then
|
||||||
else
|
cmd=('sinks')
|
||||||
cmd=('sinks' 'sources')
|
elif [[ $words == *(--record|-r)[[:space:]]* ||
|
||||||
fi
|
$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
|
fi
|
||||||
|
|
||||||
for (( i = 0; i < ${#words[@]}; i++ )) do
|
for (( i = 0; i < ${#words[@]}; i++ )) do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue