Better texts, adding info to Cargo.toml and adding README.me
Thanks ChatGPT
This commit is contained in:
parent
c8e364512a
commit
0148faec97
@ -1,7 +1,10 @@
|
||||
[package]
|
||||
name = "open-meteo-cli"
|
||||
description = "CLI to extract meteorology data from Open Meteo"
|
||||
license = "MIT"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
31
README.md
Normal file
31
README.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Open Meteo CLI
|
||||
|
||||
CLI to extract meteorology data from Open Meteo.
|
||||
|
||||
## Usage
|
||||
|
||||
The Open Meteo CLI allows you to retrieve weather data for specific coordinates.
|
||||
|
||||
### Current Weather
|
||||
|
||||
Get the current weather for a given coordinate.
|
||||
|
||||
```plaintext
|
||||
open-meteo current-weather [OPTIONS] --latitude <LATITUDE> --longitude <LONGITUDE>
|
||||
```
|
||||
|
||||
#### Options
|
||||
|
||||
- `-l, --latitude <LATITUDE>`: Latitude as a decimal number.
|
||||
- `-L, --longitude <LONGITUDE>`: Longitude as a decimal number.
|
||||
- `-a, --all`: Prints all available parameters.
|
||||
- `-d, --is-day`: Prints if it is day or night.
|
||||
- `-t, --temperature`: Prints the decimal temperature.
|
||||
- `-w, --windspeed`: Prints the decimal wind speed.
|
||||
- `-W, --winddirection`: Prints the wind direction angle.
|
||||
- `-c, --clean`: Cleans the output and only shows the values separated by commas. The order of values is as follows: is_day, temperature, windspeed, winddirection. Example output: `1,22.4,12.5,170.0`.
|
||||
|
||||
## Attribution
|
||||
|
||||
The weather data used in this application is provided by [Open-Meteo.com](https://open-meteo.com/) under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license. We would like to express our gratitude to Open-Meteo.com for their contribution to this project.
|
||||
```
|
14
src/cli.rs
14
src/cli.rs
@ -2,7 +2,7 @@ use structopt::StructOpt;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(
|
||||
name = "Open Meteo CLI",
|
||||
name = "open-meteo-cli",
|
||||
about = "CLI to extract meteorology data from Open Meteo"
|
||||
)]
|
||||
pub enum Arguments {
|
||||
@ -10,23 +10,23 @@ pub enum Arguments {
|
||||
CurrentWeather {
|
||||
#[structopt(short = "l", long, help = "Latitude as a decimal number")]
|
||||
latitude: f32,
|
||||
#[structopt(short = "L", long, help = "Altitude as a decimal number")]
|
||||
#[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 its day or night")]
|
||||
#[structopt(short = "d", long, help = "Prints if it's day or night")]
|
||||
is_day: bool,
|
||||
#[structopt(short = "t", long, help = "Prints decimal temperature")]
|
||||
#[structopt(short = "t", long, help = "Prints the decimal temperature")]
|
||||
temperature: bool,
|
||||
#[structopt(short = "w", long, help = "Prints decimal wind speed")]
|
||||
#[structopt(short = "w", long, help = "Prints the decimal wind speed")]
|
||||
windspeed: bool,
|
||||
#[structopt(short = "W", long, help = "Prints wind direction angle")]
|
||||
#[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 separates by commas.
|
||||
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"
|
||||
)]
|
||||
|
Loading…
Reference in New Issue
Block a user