From f07b3145a0d8777ad29b5d6190aa9b3a4a4d3399 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 28 Nov 2019 18:42:28 +0000 Subject: [PATCH] pash: simplify password show --- pash | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pash b/pash index 913a339..aa01f7a 100755 --- a/pash +++ b/pash @@ -56,16 +56,11 @@ pw_del() { } pw_show() { - pass=$("$gpg" -dq "$1.gpg") - - # If '$2' is defined, don't print the password to the - # terminal. For example, this is used when the password is - # copied to the clipboard. - [ "$2" ] || printf '%s\n' "$pass" + "$gpg" -dq "$1.gpg" } pw_copy() { - pw_show "$1" copy + pass=$(pw_show "$1") # Disable warning against words-splitting as it is safe # and intentional (globbing is disabled).