First commit, CLI to request the current weather from Open Meteo

This commit is contained in:
2023-05-19 00:03:14 +02:00
commit f7a7b85111
5 changed files with 698 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "Open Meteo CLI", about = "CLI to extract data from Open Meteo")]
pub enum Options {
#[structopt(about = "Get current weather from a coordinate")]
CurrentWeather {
#[structopt(short = "l", long, help = "Latitude as a decimal number")]
latitude: f32,
#[structopt(short = "g", long, help = "Altitude as a decimal number")]
longitude: f32,
#[structopt(short = "d", long, help = "Extracts if its day or night")]
is_day: bool,
#[structopt(short = "t", long, help = "Extracts decimal temperature")]
temperature: bool,
#[structopt(short = "s", long, help = "Extracts decimal wind speed")]
windspeed: bool,
#[structopt(short = "w", long, help = "Extracts angle direction")]
winddirection: bool,
#[structopt(
short = "c",
long,
help = "Clean the output, and only show the values separates by commas.
The order is: is_day, temperature, windspeed, winddirection"
)]
clean: bool,
},
}