upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit/cli.rs')
-rw-r--r--src/bin/ngit/cli.rs34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs
index 60bc5d2..5461237 100644
--- a/src/bin/ngit/cli.rs
+++ b/src/bin/ngit/cli.rs
@@ -13,7 +13,7 @@ use crate::sub_commands;
13#[command(propagate_version = true)] 13#[command(propagate_version = true)]
14pub struct Cli { 14pub struct Cli {
15 #[command(subcommand)] 15 #[command(subcommand)]
16 pub command: Commands, 16 pub command: Option<Commands>,
17 /// remote signer address 17 /// remote signer address
18 #[arg(long, global = true, hide = true)] 18 #[arg(long, global = true, hide = true)]
19 pub bunker_uri: Option<String>, 19 pub bunker_uri: Option<String>,
@@ -29,8 +29,40 @@ pub struct Cli {
29 /// disable spinner animations 29 /// disable spinner animations
30 #[arg(long, action, hide = true)] 30 #[arg(long, action, hide = true)]
31 pub disable_cli_spinners: bool, 31 pub disable_cli_spinners: bool,
32 /// show customization options via git config
33 #[arg(short, long, global = true)]
34 pub customize: bool,
32} 35}
33 36
37pub const CUSTOMISE_TEMPLATE: &str = r"
38==========================
39 Customize ngit
40==========================
41ngit settings are managed through the git config.
42
43Currently the only settings not not reachable through standard commands relate to default hardcoded relays:
44
45 - nostr.relay-default-set - must have at least 1 value
46 - nostr.relay-blaster-set
47 - nostr.relay-signer-fallback-set
48
49These take a string of semi-colon separated websocket URLs without spaces. For example:
50`git config --global nostr.relay-default-set 'wss://relay1.example.com;wss://relay2.example.com'`
51Or just for this repository:
52`git config nostr.relay-default-set 'wss://relay1.example.com;wss://relay2.example.com'`
53
54Other useful settings:
55 - 'nostr.nostate true' to avoid publishing a state event when pushing to a nostr remote.
56 - Login settings configured during `ngit account login`:
57 - nostr.nsec - nsec or ncryptsec
58 - nostr.npub - used for ncryptsec and remote signer
59 - nostr.bunker-uri - used for remote signer
60 - nostr.bunker-app-key - used for remote signer
61
62Other config settings are applied to the local repository but just for effiency reasons eg nostr.nip05 and nostr.protocol-push
63==========================
64";
65
34pub fn extract_signer_cli_arguments(args: &Cli) -> Result<Option<SignerInfo>> { 66pub fn extract_signer_cli_arguments(args: &Cli) -> Result<Option<SignerInfo>> {
35 if let Some(nsec) = &args.nsec { 67 if let Some(nsec) = &args.nsec {
36 Ok(Some(SignerInfo::Nsec { 68 Ok(Some(SignerInfo::Nsec {