diff --git a/pulseaudio-tcp.bash_completion b/pulseaudio-tcp.bash_completion index 4ee07f3..962aea1 100644 --- a/pulseaudio-tcp.bash_completion +++ b/pulseaudio-tcp.bash_completion @@ -1,7 +1,6 @@ _pulseaudio_tcp_completions() { local \ command_list \ - command_pattern \ commands \ cur \ option_list \ @@ -21,20 +20,8 @@ _pulseaudio_tcp_completions() { commands=("${commands[@]/$word}") done - if "$more_options" ; then - option_list="${options[*]}" - else - option_list="" - fi - - printf -v command_pattern "%s|" "${commands[@]}" - command_pattern="(${command_pattern%?})" - - if [[ ${COMP_WORDS[*]} =~ $command_pattern ]] ; then - command_list="" - else - command_list="${commands[*]}" - fi + "$more_options" && option_list="${options[*]}" + command_list="${commands[*]}" mapfile -t COMPREPLY < <( compgen -W "$option_list $command_list" -- "$cur")