use std::path::PathBuf;
use abscissa_core::{Command, Runnable};
use clap::{Args, Parser, Subcommand};
use organize_rs_core::config::OrganizeConfig;
#[derive(Command, Debug, Args, Clone)]
pub struct CheckConfigCmd {
#[clap(short, long)]
path: PathBuf,
}
#[derive(Debug, Args, Clone)]
pub struct CheckScriptCmd {
#[clap(short, long)]
path: PathBuf,
}
#[derive(Subcommand, Command, Debug, Runnable)]
pub enum CheckSubCmd {
Config(CheckConfigCmd),
Script(CheckScriptCmd),
}
#[derive(Command, Debug, Parser)]
pub struct CheckCmd {
#[clap(subcommand)]
commands: CheckSubCmd,
}
impl Runnable for CheckCmd {
fn run(&self) {
self.commands.run();
}
}
impl Runnable for CheckConfigCmd {
fn run(&self) {
let config = OrganizeConfig::load_from_file(&self.path);
println!("{config}");
}
}
impl Runnable for CheckScriptCmd {
fn run(&self) {
todo!()
}
}