diff --git a/completions/bash/multipass b/completions/bash/multipass index a6c75fdd63b..de4d0dcd450 100644 --- a/completions/bash/multipass +++ b/completions/bash/multipass @@ -388,7 +388,12 @@ _multipass_complete() fi if [[ -n "${opts}" ]]; then - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + for word in "${COMP_WORDS[@]}"; do + if [[ " ${opts[@]} " =~ " $word " ]]; then + opts=("${opts[@]/$word}") + fi + done + COMPREPLY=( $(compgen -W "${opts[*]}" -- ${cur}) ) fi return 0