diff options
| author | Namilskyy <alive6863@gmail.com> | 2025-03-26 21:23:12 +0300 |
|---|---|---|
| committer | Namilskyy <alive6863@gmail.com> | 2025-03-26 21:23:31 +0300 |
| commit | d075958732b9deb6a6f39dd1171144e075f013dc (patch) | |
| tree | 741962f319d6c633d71b932dc56bebc9ce37b236 /src/main.rs | |
| parent | 3d642eae40c80b31c5078d4b1d62a0a533f230d2 (diff) | |
Fixing errors, the zsh: command not found: main branch will pushed only after fixing all mistakes and bugs. Now founded 3.]
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 9f64ca4..acd3ecb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,13 +4,13 @@ extern crate image; use clap::{Arg, Command}; use termimage::{Options}; - mod configmanager; mod parser; use crate::configmanager::{Config, handle_config}; - fn main() -> Result<(), Box<dyn std::error::Error>> { + + let config = Config::load()?; let matches = Command::new("WeatherFetch") .version("0.1") .author("Borisov Alexey <arcanetmodl@gmail.com>") @@ -24,19 +24,29 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { .get_matches(); if matches.contains_id("help") { - println!("Usage: ..."); + println!("Usage:"); + println!("VALUES"); + println!("--img=, -i= image, takees a path to .jpg/.png"); + println!("--lat=, -t=, coordinates: takes f64."); + println!("--lon=, -n=, coordinates: takes f64"); + println!("--cfg=, -c=, takes a path to Config.toml"); + println!("--exclude=, -e=, takes exlude type. See the API docs"); + println!("FUNCTIONS"); + println!("--gen-conf, -g, generating standart config"); + println!("--alerts, -a, show alerts"); + return Ok(()); } - if let Some(img_path) = matches.get_one::<String>("image") { - let _img = Image::from_path(img_path)?; - } + if let Some(img_path) = matches.get_one::<String>("image") { + let _img = image::open(img_path)?; + } + - let config = Config::load()?; handle_config(&config)?; - let opts = Options::parse(); + let _opts = Options::parse(); // Prefix with underscore if not used /* if !opts { opts = configmanager::Config::load(); |
