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");
|
//let tmuxvar = var("TMUX");
|
||||||
|
|
||||||
match subcommand.as_deref() {
|
match subcommand.as_deref() {
|
||||||
Some("h") | // help text
|
Some("h" | "help")
|
||||||
Some("help") => command::help(&mut args),
|
=> command::help(&mut args),
|
||||||
|
|
||||||
Some("a") | // attach
|
Some("a" | "attach")
|
||||||
Some("attach") => command::attach(&mut args),
|
=> command::attach(&mut args),
|
||||||
|
|
||||||
Some("has") => command::has(&mut args),
|
Some("has")
|
||||||
|
=> command::has(&mut args),
|
||||||
|
|
||||||
None |
|
None |
|
||||||
Some("l") | // list
|
Some("l" | "ls" | "list")
|
||||||
Some("ls") |
|
=> command::list(),
|
||||||
Some("list") => command::list(),
|
|
||||||
|
|
||||||
Some("n") | // new
|
Some("n" | "new")
|
||||||
Some("new") => command::new(&mut args),
|
=> command::new(&mut args),
|
||||||
|
|
||||||
_ => error::no_subcommand(subcommand.unwrap())
|
_
|
||||||
|
=> error::no_subcommand(subcommand.unwrap())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue