Skip to content

Commit

Permalink
[bash] remove duplicates from completions
Browse files Browse the repository at this point in the history
  • Loading branch information
sharder996 committed Jul 11, 2023
1 parent 91ce5df commit 7928582
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion completions/bash/multipass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7928582

Please sign in to comment.