romm-cli 0.40.0

Rust-based CLI and TUI for the ROMM API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use clap::{Args, CommandFactory};
use clap_complete::aot::{generate, Shell};

use crate::commands::Cli;
use crate::error::RommError;

#[derive(Args, Debug)]
pub struct CompletionsCommand {
    /// Shell to generate completions for.
    #[arg(value_enum)]
    pub shell: Shell,
}

pub fn handle(cmd: CompletionsCommand) -> Result<(), RommError> {
    let mut cli = Cli::command();
    generate(cmd.shell, &mut cli, "romm-cli", &mut std::io::stdout());
    Ok(())
}