iocaine 3.0.0

The deadliest poison known to AI
Documentation
// SPDX-FileCopyrightText: 2025 Gergely Nagy
// SPDX-FileContributor: Gergely Nagy
//
// SPDX-License-Identifier: MIT

use anyhow::Result;
use clap::Subcommand;

use crate::Config;

mod config;
mod embeds;
mod man;

#[derive(Debug, Subcommand)]
pub enum ShowCommands {
    /// Show the finalized configuration.
    #[command(bin_name = "iocaine show config")]
    Config(config::ShowConfigArgs),
    /// Show the path or contents of resources embedded into the binary.
    #[command(bin_name = "iocaine show embeds")]
    Embeds(embeds::ShowEmbedArgs),
    /// Generate manual pages.
    #[command(bin_name = "iocaine show manuals", hide = true)]
    Manuals(man::ShowManualArgs),
}

pub fn run(config: Config, command: ShowCommands) -> Result<()> {
    match command {
        ShowCommands::Config(args) => config::run(config, &args),
        ShowCommands::Embeds(args) => embeds::run(args),
        ShowCommands::Manuals(args) => man::run(args),
    }
}