Some refactor, better texts, and fixing some issues

This commit is contained in:
2023-05-20 00:05:05 +02:00
parent f7a7b85111
commit baa19a4319
3 changed files with 71 additions and 59 deletions
+16 -10
View File
@@ -1,28 +1,34 @@
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")]
#[structopt(
name = "Open Meteo CLI",
about = "CLI to extract meteorology data from Open Meteo"
)]
pub enum Arguments {
#[structopt(about = "Gets the current weather for 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")]
#[structopt(short = "L", long, help = "Altitude as a decimal number")]
longitude: f32,
#[structopt(short = "d", long, help = "Extracts if its day or night")]
#[structopt(short = "a", long, help = "Prints all the parameters")]
all: bool,
#[structopt(short = "d", long, help = "Prints if its day or night")]
is_day: bool,
#[structopt(short = "t", long, help = "Extracts decimal temperature")]
#[structopt(short = "t", long, help = "Prints decimal temperature")]
temperature: bool,
#[structopt(short = "s", long, help = "Extracts decimal wind speed")]
#[structopt(short = "w", long, help = "Prints decimal wind speed")]
windspeed: bool,
#[structopt(short = "w", long, help = "Extracts angle direction")]
#[structopt(short = "W", long, help = "Prints wind direction angle")]
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"
help = "Cleans the output, and only shows the values separates by commas.
- ORDER: is_day, temperature, windspeed, winddirection
- EXAMPLE: 1,22.4,12.5,170.0"
)]
clean: bool,
},