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();
|
|
|
|
|
|
|
|
match subcommand.as_deref() {
|
2023-04-20 15:31:22 -04:00
|
|
|
Some("h" | "help")
|
|
|
|
=> command::help(&mut args),
|
2023-04-06 13:34:32 -04:00
|
|
|
|
2023-04-20 15:31:22 -04:00
|
|
|
Some("a" | "attach")
|
|
|
|
=> command::attach(&mut args),
|
2023-04-06 13:34:32 -04:00
|
|
|
|
2023-05-01 10:50:47 -04:00
|
|
|
Some("d" | "detach")
|
|
|
|
=> command::detach(&mut args),
|
|
|
|
|
2023-04-20 15:31:22 -04:00
|
|
|
Some("has")
|
|
|
|
=> command::has(&mut args),
|
2023-04-14 16:38:34 -04:00
|
|
|
|
2023-04-20 15:31:22 -04:00
|
|
|
None |
|
|
|
|
Some("l" | "ls" | "list")
|
|
|
|
=> command::list(),
|
2023-04-06 13:34:32 -04:00
|
|
|
|
2023-04-20 15:31:22 -04:00
|
|
|
Some("n" | "new")
|
|
|
|
=> command::new(&mut args),
|
2023-04-06 13:34:32 -04:00
|
|
|
|
2023-04-20 15:31:22 -04:00
|
|
|
_
|
|
|
|
=> error::no_subcommand(subcommand.unwrap())
|
2023-04-06 13:34:32 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|