2023-04-06 13:34:32 -04:00
|
|
|
|
|
|
|
use pico_args::Arguments;
|
|
|
|
|
|
|
|
mod command;
|
2023-04-14 16:38:34 -04:00
|
|
|
mod error;
|
2023-04-06 13:34:32 -04:00
|
|
|
mod util;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut args = Arguments::from_env();
|
|
|
|
|
|
|
|
let subcommand = args.subcommand().unwrap();
|
|
|
|
|
|
|
|
//let tmuxvar = var("TMUX");
|
|
|
|
|
|
|
|
match subcommand.as_deref() {
|
|
|
|
Some("h") | // help text
|
2023-04-14 16:38:34 -04:00
|
|
|
Some("help") => command::help(&mut args),
|
2023-04-06 13:34:32 -04:00
|
|
|
|
|
|
|
Some("a") | // attach
|
|
|
|
Some("attach") => command::attach(&mut args),
|
|
|
|
|
2023-04-14 16:38:34 -04:00
|
|
|
Some("has") => command::has(&mut args),
|
|
|
|
|
|
|
|
None |
|
2023-04-06 13:34:32 -04:00
|
|
|
Some("l") | // list
|
|
|
|
Some("ls") |
|
|
|
|
Some("list") => command::list(),
|
|
|
|
|
|
|
|
Some("n") | // new
|
|
|
|
Some("new") => command::new(&mut args),
|
|
|
|
|
2023-04-14 16:38:34 -04:00
|
|
|
_ => error::no_subcommand(subcommand.unwrap())
|
2023-04-06 13:34:32 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|