From 623ef278d001a33d10b3c3d280edd7312002e663 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Mon, 18 Mar 2024 12:57:32 +0100 Subject: [PATCH] helper: Add `-o hints` push option Works even if you have hints disabled in config. --- radicle-remote-helper/src/lib.rs | 3 +++ radicle-remote-helper/src/push.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/radicle-remote-helper/src/lib.rs b/radicle-remote-helper/src/lib.rs index 47644d76..6807c461 100644 --- a/radicle-remote-helper/src/lib.rs +++ b/radicle-remote-helper/src/lib.rs @@ -77,6 +77,8 @@ pub struct Allow { pub struct Options { /// Don't sync after push. no_sync: bool, + /// Enable hints. + hints: bool, /// Open patch in draft mode. draft: bool, /// Patch base to use, when opening or updating a patch. @@ -206,6 +208,7 @@ pub fn run(profile: radicle::Profile) -> Result<(), Error> { /// hence the arguments are passed as a slice. fn push_option(args: &[&str], opts: &mut Options) -> Result<(), Error> { match args { + ["hints"] => opts.hints = true, ["sync"] => opts.no_sync = false, ["no-sync"] => opts.no_sync = true, ["patch.draft"] => opts.draft = true, diff --git a/radicle-remote-helper/src/push.rs b/radicle-remote-helper/src/push.rs index 655a8037..a5763502 100644 --- a/radicle-remote-helper/src/push.rs +++ b/radicle-remote-helper/src/push.rs @@ -173,7 +173,7 @@ pub fn run( let signer = profile.signer()?; let mut line = String::new(); let mut ok = HashMap::new(); - let hints = profile.hints(); + let hints = opts.hints || profile.hints(); assert_eq!(signer.public_key(), &nid);