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
|
||||
|
||||
elif [[ $service == (pacat|paplay|parecord) ]]; then
|
||||
if [[ $words == *-r[[:space:]]* ]]; then
|
||||
cmd=('sources')
|
||||
elif [[ $words == *-p[[:space:]]* ]]; then
|
||||
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
|
||||
|
||||
elif [[ $service == paplay ]]; then
|
||||
case $words[$((CURRENT - 1))] in
|
||||
-d)
|
||||
if [[ $words == *(--playback|-p)[[:space:]]* ||
|
||||
$service == paplay ]]; then
|
||||
cmd=('sinks')
|
||||
elif [[ $service == parecord ]]; then
|
||||
elif [[ $words == *(--record|-r)[[:space:]]* ||
|
||||
$service == parecord ]]; then
|
||||
cmd=('sources')
|
||||
else
|
||||
cmd=('sinks' 'sources')
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
for (( i = 0; i < ${#words[@]}; i++ )) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue