upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-26 10:29:33 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-26 10:36:58 +0100
commit0134ab8eb413b8b81ec8e179897ddb8ea63e134e (patch)
tree1d3ef8786fa806a4d39378286c68cda722cc017d /src/main.rs
parent52f9efa50f81142da013c4da5f3cd3091e07916b (diff)
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...`
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs45
1 files changed, 3 insertions, 42 deletions
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 @@
3#![cfg_attr(not(test), warn(clippy::expect_used))] 3#![cfg_attr(not(test), warn(clippy::expect_used))]
4 4
5use anyhow::Result; 5use anyhow::Result;
6use clap::{Parser, Subcommand}; 6use clap::Parser;
7use cli::{Cli, Commands};
7 8
9mod cli;
8mod cli_interactor; 10mod cli_interactor;
9mod client; 11mod client;
10mod config; 12mod config;
@@ -14,47 +16,6 @@ mod login;
14mod repo_ref; 16mod repo_ref;
15mod sub_commands; 17mod sub_commands;
16 18
17#[derive(Parser)]
18#[command(author, version, about, long_about = None)]
19#[command(propagate_version = true)]
20pub struct Cli {
21 #[command(subcommand)]
22 command: Commands,
23 /// remote signer address
24 #[arg(long, global = true)]
25 bunker_uri: Option<String>,
26 /// remote signer app secret key
27 #[arg(long, global = true)]
28 bunker_app_key: Option<String>,
29 /// nsec or hex private key
30 #[arg(short, long, global = true)]
31 nsec: Option<String>,
32 /// password to decrypt nsec
33 #[arg(short, long, global = true)]
34 password: Option<String>,
35 /// disable spinner animations
36 #[arg(long, action)]
37 disable_cli_spinners: bool,
38}
39
40#[derive(Subcommand)]
41enum Commands {
42 /// update cache with latest updates from nostr
43 Fetch(sub_commands::fetch::SubCommandArgs),
44 /// signal you are this repo's maintainer accepting proposals via nostr
45 Init(sub_commands::init::SubCommandArgs),
46 /// issue commits as a proposal
47 Send(sub_commands::send::SubCommandArgs),
48 /// list proposals; checkout, apply or download selected
49 List,
50 /// send proposal revision
51 Push(sub_commands::push::SubCommandArgs),
52 /// fetch and apply new proposal commits / revisions linked to branch
53 Pull,
54 /// run with --nsec flag to change npub
55 Login(sub_commands::login::SubCommandArgs),
56}
57
58#[tokio::main] 19#[tokio::main]
59async fn main() -> Result<()> { 20async fn main() -> Result<()> {
60 let cli = Cli::parse(); 21 let cli = Cli::parse();