diff options
author | stuebinm | 2022-02-02 17:52:33 +0100 |
---|---|---|
committer | stuebinm | 2022-02-02 17:52:33 +0100 |
commit | 36acf9b9e4d35dea60ef2bfe9998d09fd6a1ebef (patch) | |
tree | b0dd150ee974ed55a8d19861d9c07acb86de329b /src/main.rs | |
parent | be7cc4ca0b7a168a9c6cd110a74d04c35956cdde (diff) |
we'll be there in -1000 minutes isn't helpful
Diffstat (limited to '')
-rw-r--r-- | src/main.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index eacbeb9..1782953 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,10 +101,15 @@ fn main() -> Result<(), ureq::Error> { match status.to_station { None => println!("{}: Fahrt ins {}", traveltext, "Blaue".blue()), - Some(to) => { + Some(to) if status.checked_in => { let now = chrono::Utc::now(); let duration = to.real_arrival().map(|dt| *dt - now); match duration { + Some(d) if d < chrono::Duration::zero() => println!( + "{}: {}", + traveltext, + "we should be there already!".green() + ), Some(d) => println!( "{}: we'll be there in {} minutes", traveltext, @@ -113,6 +118,11 @@ fn main() -> Result<(), ureq::Error> { None => println!("{}: I have no idea", traveltext) } } + Some(_to) => println!( + "{}: {}", + traveltext, + "you're not checked in".red() + ) } } Command::Checkin { from, to, train } => { |