From 68223011da04f2d76f10bb076ca159e20715eef4 Mon Sep 17 00:00:00 2001 From: mint Date: Thu, 15 Sep 2022 00:22:49 -0300 Subject: [PATCH] main: Command shortcodes This commit adds shorter versions of commands, so you can save time! --- src/main.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index e7a4790..daa42bd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,24 +30,24 @@ fn main() { let args: Vec = env::args().collect(); if args.len() >= 2 { match args[1].as_str() { - "help" => help(), - "init" => inv::init(), - "list" => { + "help" | "h" => help(), + "init" | "i" => inv::init(), + "list" | "l" => { if args.len() == 3 { inv::list(args[2].as_str()); } else { inv::list("active"); }; }, - "switch" => inv::switch(), - "take" => { + "switch" | "s" => inv::switch(), + "take" | "t" => { if args.len() == 3 { item::take(&args[2]); } else { println!("❌ {}", format!("You need to specify a file.").red()) }; }, - "drop" => { + "drop" | "d" => { if args.len() == 3 { item::drop(&args[2], match env::current_dir() { Ok(dir) => dir, @@ -82,10 +82,10 @@ fn help() { - {}: Displays this message", format!("Vento").bold().blue(), format!("Usage:").bold(), - format!("take ").bold().green(), - format!("drop [destination]").bold().green(), - format!("list [slot]").bold().green(), - format!("switch").bold().green(), - format!("init").bold().green(), - format!("help").bold().green()); + format!("take | t ").bold().green(), + format!("drop | d [destination]").bold().green(), + format!("list | l [slot]").bold().green(), + format!("switch | s").bold().green(), + format!("init | i").bold().green(), + format!("help | h").bold().green()); }