mod command;

use clap::{Parser, Subcommand};

/// latest Firefish version as of this fishctl release
const FIREFISH_VERSION: &str = "20240613";

#[derive(Parser)]
struct Args {
    #[command(subcommand)]
    command: Commands,
}

#[derive(Subcommand)]
enum Commands {
    /// Print fishctl version and the corresponding Firefish version
    Version,
    /// Modify or validate the config files
    #[command(subcommand)]
    Config(command::config::Commands),
}

fn main() -> Result<(), command::Error> {
    let args = Args::parse();

    match args.command {
        Commands::Version => command::version::run(),
        Commands::Config(subcommand) => command::config::run(subcommand)?,
    }

    Ok(())
}