diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 1712545..cb9ac6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -159,12 +159,16 @@ fn main() -> Result<(), ureq::Error> { Command::ICEPortal => { match get_request::<TripInfo>("https://iceportal.de/api1/rs/tripInfo/trip") { Ok(resp) => { - println!("{:?}", resp); + println!("{}: Currently in {}", traveltext, resp.get_train_ref()); println!("guessing last stop was: {:?}", resp.guess_last_station()); + println!("{}", resp.trip()) } - Err(_) => { + Err(err) => { + if cli.debug { + eprintln!("{:?}", err); + } println!("either this tool or the iceportal broke or you're not actually on an ICE\n\ - (get a response but couldn't to parse it)"); + (get a response but couldn't parse it)"); } } } |