From: Silvio Rhatto Date: Fri, 2 Aug 2013 22:09:13 +0000 (-0300) Subject: Avoiding duplication on git completion X-Git-Tag: 0.2.1^0 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=3cf730cd3301b476ef256a88db83b8025b03ded5;p=keyringer.git Avoiding duplication on git completion --- diff --git a/lib/keyringer/completions/bash b/lib/keyringer/completions/bash index 247b7ff..a8fce92 100644 --- a/lib/keyringer/completions/bash +++ b/lib/keyringer/completions/bash @@ -16,6 +16,14 @@ _keyringer_git_complete() { fi _git + + LAST=${COMP_WORDS[COMP_CWORD]} + REPLY=${COMPREPLY[@]} + + if [ "$REPLY" == "$LAST" ]; then + return + fi + echo ${COMPREPLY[@]} ) fi