From 0134ab8eb413b8b81ec8e179897ddb8ea63e134e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 26 Jul 2024 10:29:33 +0100 Subject: feat(remote): add nostr git remote helper as a simple proxy to the first git server listed in announcement parse clone url as `nostr://naddr123...` --- src/main.rs | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 81eaf2f..add26f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,10 @@ #![cfg_attr(not(test), warn(clippy::expect_used))] use anyhow::Result; -use clap::{Parser, Subcommand}; +use clap::Parser; +use cli::{Cli, Commands}; +mod cli; mod cli_interactor; mod client; mod config; @@ -14,47 +16,6 @@ mod login; mod repo_ref; mod sub_commands; -#[derive(Parser)] -#[command(author, version, about, long_about = None)] -#[command(propagate_version = true)] -pub struct Cli { - #[command(subcommand)] - command: Commands, - /// remote signer address - #[arg(long, global = true)] - bunker_uri: Option, - /// remote signer app secret key - #[arg(long, global = true)] - bunker_app_key: Option, - /// nsec or hex private key - #[arg(short, long, global = true)] - nsec: Option, - /// password to decrypt nsec - #[arg(short, long, global = true)] - password: Option, - /// disable spinner animations - #[arg(long, action)] - disable_cli_spinners: bool, -} - -#[derive(Subcommand)] -enum Commands { - /// update cache with latest updates from nostr - Fetch(sub_commands::fetch::SubCommandArgs), - /// signal you are this repo's maintainer accepting proposals via nostr - Init(sub_commands::init::SubCommandArgs), - /// issue commits as a proposal - Send(sub_commands::send::SubCommandArgs), - /// list proposals; checkout, apply or download selected - List, - /// send proposal revision - Push(sub_commands::push::SubCommandArgs), - /// fetch and apply new proposal commits / revisions linked to branch - Pull, - /// run with --nsec flag to change npub - Login(sub_commands::login::SubCommandArgs), -} - #[tokio::main] async fn main() -> Result<()> { let cli = Cli::parse(); -- cgit v1.2.3