rsa: print help if not args given

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2024-01-19 16:15:18 +03:00
parent a58f9b9337
commit 2ae7d09c25
Signed by: Hesham
GPG Key ID: 74876157D199B09E

5
rsa.py Normal file → Executable file
View File

@ -31,6 +31,11 @@ ID = 6
def main(): def main():
print("hesham-rsa version ", VERSION) print("hesham-rsa version ", VERSION)
if len(sys.argv) == 1:
printHelp()
sys.exit(127)
if sys.argv[1] == "gen" and len(sys.argv) == 4: ##rsa gen <keysize> <keyname> if sys.argv[1] == "gen" and len(sys.argv) == 4: ##rsa gen <keysize> <keyname>
keyFileName = sys.argv[3] keyFileName = sys.argv[3]
if keyExist(keyFileName): if keyExist(keyFileName):