Skip to content

Commit

Permalink
🐛 do not exit with error code if the user rejects the station search
Browse files Browse the repository at this point in the history
* use more expressive variable name
  • Loading branch information
ttytm committed Dec 19, 2024
1 parent e4c336e commit f9ce06e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ impl Location {
bail!("Your configuration requires you to specify a city.");
};

let prompt_user = arg_address.is_empty() && config.address.is_empty();
let show_station_search_prompt = arg_address.is_empty() && config.address.is_empty();
if config.gui.greeting {
println!("{} 🦀  {}", if prompt_user { "" } else { " " }, texts.greeting);
println!("{} 🦀  {}", if show_station_search_prompt { "" } else { " " }, texts.greeting);
}

if prompt_user {
if show_station_search_prompt {
if !Confirm::with_theme(&ColorfulTheme::default())
.with_prompt(&texts.search_station)
.interact()?
{
std::process::exit(1)
std::process::exit(0)
}

let auto_loc = ApiQuery::geo_ip().query::<GeoIpLocation>().await?;
Expand Down

0 comments on commit f9ce06e

Please sign in to comment.