use std::error::Error;
use clap::{Subcommand, ValueEnum};
#[derive(Subcommand)]
pub enum Command {
Install {
#[arg(long, short)]
all: bool,
},
Configure {
#[arg(long, short)]
all: bool,
},
Export {
#[arg(value_enum)]
filetype: FileType,
},
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
pub enum FileType {
Json,
Yaml,
}
pub trait Runnable {
fn run(&self) -> Result<(), Box<dyn Error>>;
}
pub trait Sublistable<T = Self> {
fn get_sublist(&self) -> Vec<T>;
}
pub trait Programable: Sublistable + Clone {
fn get_name(&self) -> String;
fn install(&self);
fn configure(&self);
fn is_installed(&self) -> bool;
}
pub trait Executable {
fn execute(&self);
}