Error handling for end date before start date.

This commit is contained in:
Chris Berkhout 2021-06-12 16:10:50 +02:00
parent 7d473c7dba
commit 0927e27939

View file

@ -47,6 +47,11 @@ def cli(args=None, output_file=sys.stdout):
else:
start = source.start()
logging.info(f"Using the source default start date of {start}.")
if args.end < start:
logging.critical(
f"The end date '{args.end}' preceeds the start date '{start}'!"
)
sys.exit(1)
series = Series(
base=args.pair[0],
quote=args.pair[1],