Skip to content

Commit

Permalink
Use min/max in instalooter.cli.time to extract times from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Dec 10, 2019
1 parent d26315b commit c136f68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion instalooter/cli/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ def get_times_from_cli(cli_token):
stop_date = date_from_isoformat(stop_date) if stop_date else None
except ValueError:
raise ValueError("--time parameter was not provided ISO formatted dates")
return start_date, stop_date
if start_date is not None and stop_date is not None:
return max(start_date, stop_date), min(start_date, stop_date)
else:
return stop_date, start_date

0 comments on commit c136f68

Please sign in to comment.