From d1485cf7455d38620dc27221d90e916088522d9f Mon Sep 17 00:00:00 2001 From: Valerie Date: Thu, 20 Apr 2023 15:31:22 -0400 Subject: [PATCH] cleaned up subcommand match statement --- src/main.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index d69b784..40c1055 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,23 +13,24 @@ fn main() { //let tmuxvar = var("TMUX"); match subcommand.as_deref() { - Some("h") | // help text - Some("help") => command::help(&mut args), + Some("h" | "help") + => command::help(&mut args), - Some("a") | // attach - Some("attach") => command::attach(&mut args), + Some("a" | "attach") + => command::attach(&mut args), - Some("has") => command::has(&mut args), + Some("has") + => command::has(&mut args), - None | - Some("l") | // list - Some("ls") | - Some("list") => command::list(), + None | + Some("l" | "ls" | "list") + => command::list(), - Some("n") | // new - Some("new") => command::new(&mut args), + Some("n" | "new") + => command::new(&mut args), - _ => error::no_subcommand(subcommand.unwrap()) + _ + => error::no_subcommand(subcommand.unwrap()) } }