Skip to content

Commit a243892

Browse files
authored
Merge pull request #240 from ehuss/start-without-end
--start without --end defaults `end` to be today
2 parents 83fd194 + d18caa0 commit a243892

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Diff for: src/main.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,14 @@ fn get_start_date(cfg: &Config) -> Date<Utc> {
859859
fn get_end_date(cfg: &Config) -> Date<Utc> {
860860
if let Some(Bound::Date(date)) = cfg.args.end {
861861
date
862-
} else if let Some(date) = Toolchain::default_nightly() {
863-
date
864862
} else {
865-
Utc::today()
863+
match (Toolchain::default_nightly(), &cfg.args.start) {
864+
// Neither --start or --end specified, default to the current
865+
// nightly (if available).
866+
(Some(date), None) => date,
867+
// --start only, assume --end=today
868+
_ => Utc::today(),
869+
}
866870
}
867871
}
868872

0 commit comments

Comments
 (0)