fishctl/src/main.rs

33 lines
711 B
Rust
Raw Normal View History

2024-06-20 02:07:34 +09:00
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(())
}