2022-08-05 05:28:14 +10:00
|
|
|
use clap::{command, Parser};
|
|
|
|
|
2022-08-05 05:29:01 +10:00
|
|
|
mod publish;
|
|
|
|
|
2022-08-05 05:28:14 +10:00
|
|
|
#[derive(Parser, Debug)]
|
|
|
|
struct PublishAllCratesArgs {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let matches = command!()
|
|
|
|
.propagate_version(true)
|
|
|
|
.subcommand_required(true)
|
|
|
|
.arg_required_else_help(true)
|
|
|
|
.subcommand(clap::Command::new("publish").about("Publishes agb and all subcrates"))
|
|
|
|
.get_matches();
|
|
|
|
|
2022-08-05 06:10:11 +10:00
|
|
|
let result = match matches.subcommand() {
|
2022-08-05 05:29:01 +10:00
|
|
|
Some(("publish", _)) => publish::publish(),
|
2022-08-05 05:28:14 +10:00
|
|
|
_ => 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-08-05 05:28:14 +10:00
|
|
|
}
|
|
|
|
}
|