From f1431f8a504d8b91532a6a85e63ba505a362f9b5 Mon Sep 17 00:00:00 2001 From: Christopher Teutsch Date: Mon, 26 Jun 2023 18:17:14 +0200 Subject: [PATCH] exit on missing args --- crawl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crawl.py b/crawl.py index a89f906..6a240f0 100755 --- a/crawl.py +++ b/crawl.py @@ -230,4 +230,8 @@ elif args.csv: for rate in results.rates.values(): w.writerow([rate.abbr, rate.full_name, rate.ask, rate.bid, rate.date]) else: - print(fmt_and_calc(args.amt, args.currency, results, direction)) + if args.amt and args.currency: + print(fmt_and_calc(args.amt, args.currency, results, direction)) + else: + print("Missing arguments. Exiting", file=sys.stderr) + exit(1)