From c214e1c59e54b895e32c332afc6bb8e897b01d0e Mon Sep 17 00:00:00 2001 From: Namilskyy Date: Wed, 26 Mar 2025 14:49:15 +0300 Subject: Fixing errs --- src/main.rs | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 4f15b56..9f64ca4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,14 @@ -use clap::{Arg, Command}; -use termimage; +extern crate image; + + +use clap::{Arg, Command}; +use termimage::{Options}; + mod configmanager; mod parser; -use configmanager::{Config, handle_config}; +use crate::configmanager::{Config, handle_config}; fn main() -> Result<(), Box> { let matches = Command::new("WeatherFetch") @@ -19,11 +23,11 @@ fn main() -> Result<(), Box> { .arg(Arg::new("lon").short('n').long("lon").value_name("LONGITUDE")) .get_matches(); - if matches.contains_id("help") { - println!("Usage: ..."); - return Ok(()); - } - + if matches.contains_id("help") { + println!("Usage: ..."); + return Ok(()); + } + if let Some(img_path) = matches.get_one::("image") { let _img = Image::from_path(img_path)?; } @@ -31,5 +35,17 @@ fn main() -> Result<(), Box> { let config = Config::load()?; handle_config(&config)?; + + let opts = Options::parse(); + /* + if !opts { + opts = configmanager::Config::load(); + } + + let format = ops::guess_format(&opts.image)?; + let img = ops::load_image(&opts.image, format)?; + + */ + Ok(()) -} \ No newline at end of file +} -- cgit v1.2.3