use clap::Subcommand;
use eyre::Result;
mod driver;
mod install;
mod status;
mod upgrade;
#[path = "use.rs"]
mod r#use;
#[derive(Debug, clap::Args)]
#[clap(verbatim_doc_comment)]
pub struct System {
#[clap(subcommand)]
command: Commands,
}
#[derive(Debug, Subcommand)]
enum Commands {
Install(install::SystemInstall),
Status(status::SystemStatus),
Upgrade(upgrade::SystemUpgrade),
Use(r#use::SystemUse),
}
impl System {
pub async fn run(self) -> Result<()> {
match self.command {
Commands::Install(cmd) => cmd.run().await,
Commands::Status(cmd) => cmd.run().await,
Commands::Upgrade(cmd) => cmd.run().await,
Commands::Use(cmd) => cmd.run().await,
}
}
}