From ff23a11e632812b685f594324e6004c6da81cd4d Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 5 Feb 2023 09:23:29 +0100 Subject: Fixed update shit not correctly updating --- src/main.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index d177c3e..32727c7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,20 @@ use std::{env, process}; -use modlist::{config::Cfg, input::{get_input, Cmd}, update, download, list, io, modification}; +use modlist::{config::Cfg, input::{get_input, Cmd}, update, download, list, io, modification, setup}; #[tokio::main] async fn main() { let config = Cfg::init("modlist.toml").unwrap(); - + let mut args: Vec = env::args().collect(); args.reverse(); args.pop(); args.reverse(); + + if args.is_empty() { + println!("Please enter an argument"); + process::exit(1); + }; let input = match get_input(config.clone(), args).await { Ok(i) => i, @@ -19,8 +24,6 @@ async fn main() { } }; - //dbg!(&input); - match input.clone().command.unwrap() { Cmd::Mod => { modification(config, input).await @@ -41,6 +44,9 @@ async fn main() { show_version(); Ok(()) }, + Cmd::Setup => { + setup(config).await + }, }.unwrap() } -- cgit v1.2.3