From 5733d038779f41d64f9a7633b7daefd44699d1c7 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 1 Oct 2022 19:44:21 +0100 Subject: [PATCH] Add verify_cli for main too --- tools/src/main.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/src/main.rs b/tools/src/main.rs index 09fce409..676c7388 100644 --- a/tools/src/main.rs +++ b/tools/src/main.rs @@ -3,12 +3,15 @@ use clap::Command; mod publish; -fn main() { - let matches = Command::new("Agb tools") +fn cli() -> Command { + Command::new("Agb tools") .subcommand_required(true) .arg_required_else_help(true) .subcommand(publish::command()) - .get_matches(); +} + +fn main() { + let matches = cli().get_matches(); let result = match matches.subcommand() { Some(("publish", arg_matches)) => publish::publish(arg_matches), @@ -19,3 +22,13 @@ fn main() { eprintln!("Error: {:?}", e); } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn verify_cli() { + cli().debug_assert(); + } +}