exit on missing args
This commit is contained in:
parent
cf1b6dade9
commit
f1431f8a50
4
crawl.py
4
crawl.py
@ -230,4 +230,8 @@ elif args.csv:
|
|||||||
for rate in results.rates.values():
|
for rate in results.rates.values():
|
||||||
w.writerow([rate.abbr, rate.full_name, rate.ask, rate.bid, rate.date])
|
w.writerow([rate.abbr, rate.full_name, rate.ask, rate.bid, rate.date])
|
||||||
else:
|
else:
|
||||||
|
if args.amt and args.currency:
|
||||||
print(fmt_and_calc(args.amt, args.currency, results, direction))
|
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