aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/gnupg.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/gnupg.bash')
-rw-r--r--bash/bashrc.d/gnupg.bash11
1 files changed, 6 insertions, 5 deletions
diff --git a/bash/bashrc.d/gnupg.bash b/bash/bashrc.d/gnupg.bash
index e5962d21..44697f58 100644
--- a/bash/bashrc.d/gnupg.bash
+++ b/bash/bashrc.d/gnupg.bash
@@ -1,8 +1,3 @@
-# Bail if no gpg(1)
-if ! hash gpg 2>/dev/null ; then
- return
-fi
-
# Wrapper around gpg(1) to stop ``--batch'' breaking things
gpg() {
case $* in
@@ -19,6 +14,12 @@ gpg() {
_gpg() {
local word=${COMP_WORDS[COMP_CWORD]}
+ # Bail if no gpg(1)
+ if ! hash gpg 2>/dev/null ; then
+ COMPREPLY=()
+ return 1
+ fi
+
# Bail if word doesn't start with two dashes
if [[ $word != --* ]] ; then
COMPREPLY=()