diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-02 00:24:39 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-02 00:24:39 +1200 |
commit | ef9a12e780efdd1eb0ddcb745b9d93e312353b73 (patch) | |
tree | 52672882a2f8c89cd76ef5df0ef706e8bbb933d5 /bash/bashrc.d/gpg.bash | |
parent | Terser pa/paz implementations (diff) | |
download | dotfiles-ef9a12e780efdd1eb0ddcb745b9d93e312353b73.tar.gz dotfiles-ef9a12e780efdd1eb0ddcb745b9d93e312353b73.zip |
Use set rather than building arg arrays
Allows for terser functions and avoids error-prone local variables; also
nicer to have a single `command` call at the end of the function
(although there are still two at the end of the ed(1) wrapper)
Diffstat (limited to 'bash/bashrc.d/gpg.bash')
-rw-r--r-- | bash/bashrc.d/gpg.bash | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bash/bashrc.d/gpg.bash b/bash/bashrc.d/gpg.bash index 446475dc..28c5b722 100644 --- a/bash/bashrc.d/gpg.bash +++ b/bash/bashrc.d/gpg.bash @@ -1,15 +1,12 @@ # Wrapper around gpg(1) to stop ``--batch'' breaking things gpg() { - local argstring - argstring=$* - case $argstring in + # shellcheck disable=SC2048 + case $* in *--ed*|*--gen-k*|*--sign-k*) - command gpg --no-batch "$@" - ;; - *) - command gpg "$@" + set -- --no-batch "$@" ;; esac + command gpg "$@" } # Completion for gpg with long options |