aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/gnupg.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-13 17:43:25 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-13 17:43:25 +1300
commitdaf62af720e66f8059982bf3638d37534aba54aa (patch)
tree0567470ec0a169850e7585b6b38c3f27a49aa554 /bash/bashrc.d/gnupg.bash
parentFix alphabetical order (diff)
downloaddotfiles-daf62af720e66f8059982bf3638d37534aba54aa.tar.gz
dotfiles-daf62af720e66f8059982bf3638d37534aba54aa.zip
Remove some overzealous command checks
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=()