2023-02-05 23:50:59 -05:00
|
|
|
use std::process;
|
|
|
|
|
|
|
|
pub mod commands;
|
|
|
|
pub mod hash;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
if let Some(progname) = shitbox::progname() {
|
|
|
|
if let Some(command) = commands::get(&progname) {
|
|
|
|
let cli = command.cli();
|
|
|
|
if let Err(e) = command.run(&cli.get_matches()) {
|
|
|
|
eprintln!("{progname}: Error: {e}");
|
|
|
|
process::exit(1);
|
|
|
|
}
|
|
|
|
} else {
|
2023-02-08 16:20:25 -05:00
|
|
|
eprintln!("hashbox: Error: unknown command {progname}");
|
2023-02-05 23:50:59 -05:00
|
|
|
process::exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|