Support checking multiple passwords with a single invocation

This commit is contained in:
Michal Nazarewicz 2019-03-13 01:20:10 +00:00
parent df6a0f1007
commit 366b730905

View File

@ -18,12 +18,14 @@ def lookup_pwned_api(pwd):
def main(args): def main(args):
api_return = lookup_pwned_api(args[0]) for pwd in args:
if api_return: api_return = lookup_pwned_api(pwd)
print(args[0], "was found") if (api_return):
print("Hash {0}, {1} occurences".format(api_return[0], api_return[1])) print(pwd, "was found")
else: print("Hash {0}, {1} occurences".format(
print(args[0], "was not found") api_return[0], api_return[1]))
else:
print(pwd, "was not found")
if __name__ == '__main__': if __name__ == '__main__':