From d0a27fc7828aee5ca7d4c56a9c9f9f5b08878fbf Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 21 May 2025 13:16:25 +0100 Subject: feat: add --customize flag for instructions of how to customise ngit via git config items --- src/bin/ngit/cli.rs | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/bin/ngit/cli.rs') 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; #[command(propagate_version = true)] pub struct Cli { #[command(subcommand)] - pub command: Commands, + pub command: Option, /// remote signer address #[arg(long, global = true, hide = true)] pub bunker_uri: Option, @@ -29,8 +29,40 @@ pub struct Cli { /// disable spinner animations #[arg(long, action, hide = true)] pub disable_cli_spinners: bool, + /// show customization options via git config + #[arg(short, long, global = true)] + pub customize: bool, } +pub const CUSTOMISE_TEMPLATE: &str = r" +========================== + Customize ngit +========================== +ngit settings are managed through the git config. + +Currently the only settings not not reachable through standard commands relate to default hardcoded relays: + + - nostr.relay-default-set - must have at least 1 value + - nostr.relay-blaster-set + - nostr.relay-signer-fallback-set + +These take a string of semi-colon separated websocket URLs without spaces. For example: +`git config --global nostr.relay-default-set 'wss://relay1.example.com;wss://relay2.example.com'` +Or just for this repository: +`git config nostr.relay-default-set 'wss://relay1.example.com;wss://relay2.example.com'` + +Other useful settings: + - 'nostr.nostate true' to avoid publishing a state event when pushing to a nostr remote. + - Login settings configured during `ngit account login`: + - nostr.nsec - nsec or ncryptsec + - nostr.npub - used for ncryptsec and remote signer + - nostr.bunker-uri - used for remote signer + - nostr.bunker-app-key - used for remote signer + +Other config settings are applied to the local repository but just for effiency reasons eg nostr.nip05 and nostr.protocol-push +========================== +"; + pub fn extract_signer_cli_arguments(args: &Cli) -> Result> { if let Some(nsec) = &args.nsec { Ok(Some(SignerInfo::Nsec { -- cgit v1.2.3