2024-07-31 21:56:22 -04:00
|
|
|
use clap::Parser;
|
|
|
|
|
use std::error::Error;
|
|
|
|
|
|
|
|
|
|
#[derive(Parser, Debug)]
|
|
|
|
|
#[command(version, about, long_about = None)]
|
|
|
|
|
struct Args {
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
setup: bool,
|
|
|
|
|
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
load: bool,
|
|
|
|
|
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
run: bool,
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-16 17:58:58 -05:00
|
|
|
#[tokio::main]
|
2024-07-31 21:56:22 -04:00
|
|
|
async fn main() -> Result<(), Box<dyn Error>> {
|
|
|
|
|
let args = Args::parse();
|
|
|
|
|
|
|
|
|
|
if args.setup {
|
|
|
|
|
println!("Setup was passed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if args.load {
|
|
|
|
|
achubb_backend::run_load().await?;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if args.run || !(args.load || args.setup) {
|
|
|
|
|
achubb_backend::run_server().await?;
|
|
|
|
|
}
|
2023-12-17 14:45:33 -05:00
|
|
|
Ok(())
|
|
|
|
|
}
|