cargo-governor 2.0.3

Machine-First, LLM-Ready, CI/CD-Native release automation tool for Rust crates
Documentation
//! Show owners command.

use governor_application::owners::{OwnersShowInput, show};

use crate::cli::{OutputFormat, OwnersSubCommands};
use crate::error::{CommandExitCode, Result};
use crate::presenter::print_json;
use crate::runtime::cargo_adapter;

pub async fn show_cmd(
    workspace_path: &str,
    opts: &OwnersSubCommands,
    _format: OutputFormat,
) -> Result<CommandExitCode> {
    let (all, explain) = match opts {
        OwnersSubCommands::Show { all, explain } => (*all, *explain),
        _ => (false, false),
    };
    let started_at = std::time::Instant::now();
    let cargo = cargo_adapter();
    let output = show(
        &cargo,
        OwnersShowInput {
            workspace_path: workspace_path.to_string(),
            all,
            explain,
        },
    )
    .await?;
    let workspace = output.workspace.clone();
    print_json(
        "owners.show",
        Some(workspace),
        true,
        output,
        started_at,
        Vec::new(),
    )?;
    Ok(CommandExitCode::Success)
}