exit on missing args
This commit is contained in:
parent
cf1b6dade9
commit
f1431f8a50
6
crawl.py
6
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)
|
||||
|
Loading…
Reference in New Issue
Block a user