Files
pulseaudio-tcp/pulseaudio-tcp.bash_completion
2025-05-18 01:18:52 +02:00

23 lines
703 B
Plaintext

_pulseaudio_tcp_completions() {
local cur options commands delete
cur=${COMP_WORDS[COMP_CWORD]}
options=( "--debug" "--help" "--nogui" )
commands=( "start" "stop" "status" "setup" "restart" )
for delete in "${COMP_WORDS[@]::${#COMP_WORDS[@]}-1}" ; do
options=("${options[@]/$delete}")
commands=("${commands[@]/$delete}")
done
COMPREPLY=()
case "$cur" in
'') mapfile -t COMPREPLY < <(compgen -W "${options[*]} ${commands[*]}" -- "$cur") ;;
-*) mapfile -t COMPREPLY < <(compgen -W "${options[*]}" -- "$cur") ;;
[^-]*) mapfile -t COMPREPLY < <(compgen -W "${commands[*]}" -- "$cur") ;;
esac
return 0
} && complete -F _pulseaudio_tcp_completions pulseaudio-tcp