vdev/commands/integration/
show.rs

1use crate::{
2    commands::compose_tests::show::{exec, exec_environments_only},
3    testing::config::INTEGRATION_TESTS_DIR,
4};
5use anyhow::Result;
6use clap::Args;
7
8/// Show information about integrations
9#[derive(Args, Debug)]
10#[command()]
11pub struct Cli {
12    /// The desired integration
13    integration: Option<String>,
14
15    /// Show only the available environments (newline separated)
16    #[arg(short = 'e', long)]
17    environments_only: bool,
18}
19
20impl Cli {
21    pub fn exec(self) -> Result<()> {
22        if self.environments_only {
23            exec_environments_only(
24                &self.integration.expect("test name is required"),
25                INTEGRATION_TESTS_DIR,
26            )
27        } else {
28            exec(self.integration.as_ref(), INTEGRATION_TESTS_DIR)
29        }
30    }
31}