tessen

default description
git clone https://git.awy.one/tessen.git
Log | Files | Refs | README | LICENSE

commit 4c60341519bc0471b07a049143400cc2112c83c6
parent 19ad5f90a1a696b8e7b8bf62fce0176852230809
Author: Ayush Agarwal <ayush@fastmail.in>
Date:   Wed,  8 Sep 2021 01:02:47 +0530

add trap and reorganize global vars

Diffstat:
Mtessen | 19+++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/tessen b/tessen @@ -7,20 +7,13 @@ readonly PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" export PATH umask 077 +# initialize the global variables BACKEND="bemenu" CLIP_TIME=15 WTYPE="" - - -readonly CLIP_TIME -readonly BACKEND -readonly WTYPE - - -# initialize the primary global variables readonly PASS_STORE="${PASSWORD_STORE_DIR:-$HOME/.password-store}" -PASSFILE="" # password file chosen by the user for decryption -declare -A PASSDATA_ARR # decrypted password-store data except the password +PASSFILE="" +declare -A PASSDATA_ARR USERNAME="" PASSWORD="" CHOICE="" @@ -241,9 +234,14 @@ main() { unset -v opt shift $((OPTIND - 1)) + readonly WTYPE + readonly BACKEND + readonly CLIP_TIME + validate_backend validate_clip_time + trap 'die' EXIT TERM get_pass_file get_pass_data @@ -254,6 +252,7 @@ main() { choice_data_copy key_menu_copy fi + trap - EXIT TERM } main "$@"