mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Add verify_cli for main too
This commit is contained in:
parent
aecd4077da
commit
5733d03877
|
@ -3,12 +3,15 @@ use clap::Command;
|
||||||
|
|
||||||
mod publish;
|
mod publish;
|
||||||
|
|
||||||
fn main() {
|
fn cli() -> Command {
|
||||||
let matches = Command::new("Agb tools")
|
Command::new("Agb tools")
|
||||||
.subcommand_required(true)
|
.subcommand_required(true)
|
||||||
.arg_required_else_help(true)
|
.arg_required_else_help(true)
|
||||||
.subcommand(publish::command())
|
.subcommand(publish::command())
|
||||||
.get_matches();
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let matches = cli().get_matches();
|
||||||
|
|
||||||
let result = match matches.subcommand() {
|
let result = match matches.subcommand() {
|
||||||
Some(("publish", arg_matches)) => publish::publish(arg_matches),
|
Some(("publish", arg_matches)) => publish::publish(arg_matches),
|
||||||
|
@ -19,3 +22,13 @@ fn main() {
|
||||||
eprintln!("Error: {:?}", e);
|
eprintln!("Error: {:?}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn verify_cli() {
|
||||||
|
cli().debug_assert();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue