#[macro_use]
extern crate log;
use clap::Parser;
use color_eyre::eyre::Result;
use dotenv::dotenv;
use gatling::{
actions::shoot::shoot,
cli::{Cli, Command},
config::GatlingConfig,
};
#[tokio::main]
async fn main() -> Result<()> {
env_logger::init();
color_eyre::install()?;
dotenv().ok();
info!("Starting Gatling...");
let cli = Cli::parse();
let cfg = match cli.global_opts.config_path {
Some(path) => GatlingConfig::from_file(&path)?,
None => GatlingConfig::new()?,
};
match cli.command {
Command::Shoot { .. } => {
let gatling_report = shoot(cfg).await?;
info!("Gatling completed: {:#?}", gatling_report);
}
}
Ok(())
}