cora-code 0.16.0

CLI-first AI code review — BYOK, diff/scan/branch, pre-commit hooks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use anyhow::Result;
use clap::CommandFactory;
use clap_complete::aot::{Shell, generate};

use crate::Cli;

pub fn execute_completion(shell: &str) -> Result<i32> {
    let shell: Shell = shell.parse().map_err(|_| {
        anyhow::anyhow!("Invalid shell: {shell}. Supported shells: bash, zsh, fish, powershell")
    })?;

    let mut cmd = Cli::command();
    generate(shell, &mut cmd, "cora", &mut std::io::stdout());

    Ok(0)
}