summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index e97db13..d6b7abd 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -138,6 +138,12 @@ pub fn get_location(coords_args: bool) -> Result<(), BoxedError> {
.clone();
if (config.lat == 0.0 || config.lon == 0.0) && !coords_args {
+
+ println!("No coordinates in configuration file or conf not founded.");
+ println!("HINT: Try create ~/.config/WeatherFetch/Config.toml");
+ println!("HINT: And add `lat(<float>)`, `lon(<float>)`.");
+ println!("HINT: To get more info check https://openweathermap.org/api/one-call-3");
+
Err("Invalid coordinates in config".into())
} else {
Ok(())
@@ -165,4 +171,4 @@ pub async fn parse_weather() -> Result<WeatherData, Box<dyn std::error::Error>>
let weather_data: WeatherData = response.json().await?;
Ok(weather_data)
-} \ No newline at end of file
+}