upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/nostr_git_remote_helper/src/main.rs
blob: 849396cd2bb8f5a1c1485e7540d1e7a7d64a7ff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#![cfg_attr(not(test), warn(clippy::pedantic))]
#![cfg_attr(not(test), warn(clippy::expect_used))]

use anyhow::Result;
use clap::{Parser, Subcommand};

mod sub_commands;

#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
pub struct Cli {
    #[command(subcommand)]
    command: Commands,
}

#[derive(Subcommand)]
enum Commands {
    /// replace with an actual subcommand
    Placeholder(sub_commands::placeholder::SubCommandArgs),
    Capabilities(),
    // list
    //  - get git list from remote git server
    //  - suppliment list with open prs and send back
    //    - get prs
    //    - get commits against pr
    //    - find most recent commit against pr
}

#[tokio::main]
async fn main() -> Result<()> {
    let cli = Cli::parse();
    match &cli.command {
        Commands::Capabilities() => sub_commands::capabilities::launch(),
        Commands::Placeholder(args) => {
            sub_commands::placeholder::launch(&cli, args).await
        }
    }
}