ai-model-vault 4.6.1

DEPRECATED - renamed to `ironvault`. This crate is no longer maintained; 4.6.1 is identical to 4.6.0 apart from this notice.
Documentation
//! CLI handler for license scanning (aim license-scan).

use std::path::PathBuf;

use ai_model_vault::{LicenseScanner, Result, VaultError};

pub fn handle_license_scan(path: PathBuf, format: String) -> Result<()> {
    let report = if path.is_dir() {
        LicenseScanner::scan_directory(&path)?
    } else {
        LicenseScanner::scan_file(&path)?
    };

    match format.as_str() {
        "json" => {
            let json = serde_json::to_string_pretty(&report)
                .map_err(|e| VaultError::SerializationError(e.to_string()))?;
            println!("{}", json);
        }
        _ => {
            println!("{}", report.display());
        }
    }

    Ok(())
}