From 6aa9a663b5183ccc8ede946be68dc9e733ae1b0a Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 27 Feb 2023 16:17:16 -0500 Subject: [PATCH] Fixed gen arguments preferring update mode regardless of arguments Former-commit-id: 6854fff9cce1db65f4784265f3ba4bfc1efa33a6 Former-commit-id: 67a2d47e1f6ccd8bf6bc957aec575c72d8c8ff90 --- lib/sshyp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 869eefb..6427cba 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -715,7 +715,8 @@ def gen(): # generates a password for a new or an existing entry else: _entry_name = entry_name_fetch() _shm_folder, _shm_entry = shm_gen() - if arg_count > 1 and arguments[arg_start_p] in ('update', '-u'): # gen update + if ((arg_count == 2 and arg_start == 0) or (arg_count == 3 and arg_start == 1)) and arguments[arg_start_p] \ + in ('update', '-u'): # gen update if not Path(f"{directory}{_entry_name}.gpg").is_file(): print(f"\n\u001b[38;5;9merror: entry (/{_entry_name}) does not exist\u001b[0m\n") s_exit(2)