agb/tools/src/main.rs

35 lines
694 B
Rust
Raw Normal View History

2022-08-05 07:24:25 +10:00
#![deny(clippy::all)]
use clap::Command;
mod publish;
2022-10-02 05:44:21 +11:00
fn cli() -> Command {
Command::new("Agb tools")
.subcommand_required(true)
.arg_required_else_help(true)
2022-08-05 06:36:24 +10:00
.subcommand(publish::command())
2022-10-02 05:44:21 +11:00
}
fn main() {
let matches = cli().get_matches();
2022-08-05 06:10:11 +10:00
let result = match matches.subcommand() {
2022-08-05 06:36:24 +10:00
Some(("publish", arg_matches)) => publish::publish(arg_matches),
_ => unreachable!("Exhausted list of subcommands and subcommand_required prevents `None`"),
2022-08-05 06:10:11 +10:00
};
if let Err(e) = result {
eprintln!("Error: {:?}", e);
}
}
2022-10-02 05:44:21 +11:00
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn verify_cli() {
cli().debug_assert();
}
}