breadone d5b9431547
Added sys subcommand
Add restart subsubcommand
2024-07-30 11:18:54 +12:00

40 lines
789 B
Rust

mod git;
mod sys;
use sys::{SysCommand, handle_sys};
use tokio;
use clap::{Parser, Subcommand};
use crate::git::{handle_git, GitCommand};
#[derive(Subcommand)]
enum Command {
/// Various commands for creating and adding git repos to breadpi.
Git {
#[command(subcommand)]
git_command: GitCommand
},
Sys {
#[command(subcommand)]
sys_command: SysCommand
}
}
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
#[command(subcommand)]
command: Command,
}
#[tokio::main]
async fn main() {
let cli = Cli::parse();
match &cli.command {
Command::Git { git_command } => { handle_git(&git_command).await; },
Command::Sys { sys_command } => { handle_sys(&sys_command).await; }
}
}