diff options
Diffstat (limited to 'bash/bash_completion.d/gpg.bash')
-rw-r--r-- | bash/bash_completion.d/gpg.bash | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bash/bash_completion.d/gpg.bash b/bash/bash_completion.d/gpg.bash index 2855a1a9..0f6785f9 100644 --- a/bash/bash_completion.d/gpg.bash +++ b/bash/bash_completion.d/gpg.bash @@ -5,13 +5,18 @@ _gpg() { hash gpg 2>/dev/null || return 1 # Bail if not completing an option - [[ ${COMP_WORDS[COMP_CWORD]} == --* ]] || return 1 + case ${COMP_WORDS[COMP_CWORD]} in + --*) return 1 ;; + esac # Generate completion reply from gpg(1) options local option while read -r option ; do - [[ $option == "${COMP_WORDS[COMP_CWORD]}"* ]] || continue - COMPREPLY[${#COMPREPLY[@]}]=$option + case $option in + "${COMP_WORDS[COMP_CWORD]}"*) + COMPREPLY[${#COMPREPLY[@]}]=$option + ;; + esac done < <(gpg --dump-options 2>/dev/null) } complete -F _gpg -o bashdefault -o default gpg |