34 lines
609 B
Rust
34 lines
609 B
Rust
mod git;
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
|
|
#[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;
|
|
},
|
|
}
|
|
}
|