use crate::{
commands::compose_tests::show::{exec, exec_environments_only},
testing::config::E2E_TESTS_DIR,
};
use anyhow::Result;
use clap::Args;
#[derive(Args, Debug)]
#[command()]
pub struct Cli {
test: Option<String>,
#[arg(short = 'e', long)]
environments_only: bool,
}
impl Cli {
pub fn exec(self) -> Result<()> {
if self.environments_only {
exec_environments_only(&self.test.expect("test name is required"), E2E_TESTS_DIR)
} else {
exec(self.test.as_ref(), E2E_TESTS_DIR)
}
}
}