add complement wrapper xtask script

This commit is contained in:
Benjamin Lee 2024-06-20 19:06:57 -07:00
parent 3f89bc4a7c
commit ef6eb27b9b
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4
10 changed files with 292 additions and 0 deletions

30
xtask/src/main.rs Normal file
View file

@ -0,0 +1,30 @@
mod complement;
use std::process::ExitCode;
use clap::{Parser, Subcommand};
#[derive(Parser)]
struct Args {
#[clap(subcommand)]
command: Command,
}
#[derive(Subcommand)]
enum Command {
Complement(complement::Args),
}
fn main() -> ExitCode {
let args = Args::parse();
let result = match args.command {
Command::Complement(args) => complement::main(args),
};
let Err(e) = result else {
return ExitCode::SUCCESS;
};
// Include a leading newline because sometimes an error will occur in
// the middle of displaying a progress indicator.
eprintln!("\n{e:?}");
ExitCode::FAILURE
}