update completion
This commit is contained in:
parent
d93979c527
commit
6c9e822ccf
1 changed files with 8 additions and 2 deletions
|
@ -8,18 +8,24 @@ _pulseaudio_tcp_completions() {
|
||||||
options \
|
options \
|
||||||
word
|
word
|
||||||
|
|
||||||
options=( "--debug" "--help" "--no-gui" )
|
options=( "--debug" "--help" "--no-gui" "--" )
|
||||||
commands=( "start" "stop" "status" "setup" "restart" )
|
commands=( "start" "stop" "status" "setup" "restart" )
|
||||||
|
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
cur=${COMP_WORDS[COMP_CWORD]}
|
||||||
|
more_options=true
|
||||||
|
|
||||||
for word in "${COMP_WORDS[@]}" ; do
|
for word in "${COMP_WORDS[@]}" ; do
|
||||||
[[ $word = "$cur" ]] && continue
|
[[ $word = "$cur" ]] && continue
|
||||||
|
[[ $word = -- ]] && more_options=false
|
||||||
options=("${options[@]/$word}")
|
options=("${options[@]/$word}")
|
||||||
commands=("${commands[@]/$word}")
|
commands=("${commands[@]/$word}")
|
||||||
done
|
done
|
||||||
|
|
||||||
option_list="${options[*]}"
|
if "$more_options" ; then
|
||||||
|
option_list="${options[*]}"
|
||||||
|
else
|
||||||
|
option_list=""
|
||||||
|
fi
|
||||||
|
|
||||||
printf -v command_pattern "%s|" "${commands[@]}"
|
printf -v command_pattern "%s|" "${commands[@]}"
|
||||||
command_pattern="(${command_pattern%?})"
|
command_pattern="(${command_pattern%?})"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue