//! Handler for `mcptest lint`.

use anyhow::Result;

use crate::cli::args::lint::{LintArgs as CliLintArgs, LintFormat as CliLintFormat};
use crate::commands;

/// Map the CLI args struct to [`commands::LintArgs`] and run the scan.
pub(crate) fn lint_command(args: CliLintArgs) -> Result<i32> {
    let format = match args.format {
        CliLintFormat::Pretty => commands::LintFormat::Pretty,
        CliLintFormat::Json => commands::LintFormat::Json,
    };
    commands::run_lint(commands::LintArgs {
        paths: args.paths,
        format,
        no_fail: args.no_fail,
    })
}
