Files
open-meteo-cli/src/cli.rs
T

36 lines
1.2 KiB
Rust

use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[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 = "L", long, help = "Longitude as a decimal number")]
longitude: f32,
#[structopt(short = "a", long, help = "Prints all the parameters")]
all: bool,
#[structopt(short = "d", long, help = "Prints if it's day or night")]
is_day: bool,
#[structopt(short = "t", long, help = "Prints the decimal temperature")]
temperature: bool,
#[structopt(short = "w", long, help = "Prints the decimal wind speed")]
windspeed: bool,
#[structopt(short = "W", long, help = "Prints the wind direction angle")]
winddirection: bool,
#[structopt(
short = "c",
long,
help = "Cleans the output and only shows the values separated by commas.
- ORDER: is_day, temperature, windspeed, winddirection
- EXAMPLE: 1,22.4,12.5,170.0"
)]
clean: bool,
},
}