From a81c9bdf32d3e05a7ca648faf152e6eeeedafad7 Mon Sep 17 00:00:00 2001 From: TitanE Date: Thu, 18 Jan 2024 13:40:45 +0300 Subject: [PATCH] Optimizing user commands to prevent conflicts (v1.0.4) --- keyvault.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/keyvault.py b/keyvault.py index ea7f3cc..1c1560a 100644 --- a/keyvault.py +++ b/keyvault.py @@ -187,8 +187,8 @@ print("\nkeyvault initialized.") print("keyvault is ready to use! Type 'help' for a list of commands.\n") while True: - command = input("> ")[0].lower() - if command == 'h': + command = input("> ")[0:2].lower() + if command[0] == 'h': print(""" Usage: @@ -204,22 +204,22 @@ version - print current version quit - quit the program """) - elif command == 's' or command == 'f': + elif command[0] == 's' or command[0] == 'f': find() - elif command == 'l': + elif command[0] == 'l': ls() - elif command == 'a': + elif command[0] == 'a': add() - elif command == 'r': + elif command[0] == 'r': rm() - elif command == 'e': + elif command == 'ed': edit() - elif command == 'v': - print("keyvault: v1.0.3") - elif command == 'g': + elif command[0] == 'v': + print("keyvault: v1.0.4") + elif command[0] == 'g': gen() - elif command == 's': + elif command[0] == 's': strength() - elif command == 'q': + elif command[0] == 'q' or command == 'ex': print("Thank for you using keyvault!") exit()