cleaned up subcommand match statement
This commit is contained in:
parent
07bd6af1a9
commit
d1485cf745
1 changed files with 13 additions and 12 deletions
23
src/main.rs
23
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(),
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue