diff options
author | stuebinm | 2022-02-01 16:59:23 +0100 |
---|---|---|
committer | stuebinm | 2022-02-01 16:59:23 +0100 |
commit | 4b596c9c849b310d8b7952a4c16fcdd33b34e902 (patch) | |
tree | f17823f77611346cf3e9921ebe934a0c2a2c6afc /src/main.rs | |
parent | 02ecd1cbd159823b0ab36541b51ee4cb47bf2c95 (diff) |
add `traveltext destination`
I have no intention of going to Hamburg today, so I need to check out earlier
Diffstat (limited to '')
-rw-r--r-- | src/main.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index a0984e6..1712545 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,10 @@ enum Command { #[clap(flatten)] train: TrainRef, }, + /// (If already checked in) change the trip's destination + Destination { + to: String + }, /// If iceportal.de is available, ask it which train we're in and /// check in Autocheckin, @@ -102,6 +106,19 @@ fn main() -> Result<(), ureq::Error> { ); println!("{}: {}", traveltext, resp); + }, + Command::Destination { to } => { + let resp: Response = exiting_post_request( + &format!("{}/api/v1/travel", cli.baseurl), + Action::CheckOut { + to_station: to, + force: false, + token: config.token_travel, + comment: None + }, + cli.debug + ); + println!("{}: {}", traveltext, resp); } Command::Undo => { let resp: Response = exiting_post_request( |