exit on missing args

This commit is contained in:
Christopher Teutsch 2023-06-26 18:17:14 +02:00
parent cf1b6dade9
commit f1431f8a50

View File

@ -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)