From 8558cc2233b20326dbc5e32c966c0a6f22c8b53a Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Wed, 17 Sep 2025 08:27:27 +0200 Subject: [PATCH] cli/self: `--nid` deprecation warning to stderr Printing the warning to standard output breaks scripts. Instead, print to standard error. --- CHANGELOG.md | 1 + crates/radicle-cli/examples/rad-self.md | 6 +++++- crates/radicle-cli/src/commands/self.rs | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b7db4f5..645f5a56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Deprecations +- The option `rad self --nid` was deprecated in favor of `rad status --only nid` ## New Features - `rad clone` now supports the flag `--bare` which works analoguously to diff --git a/crates/radicle-cli/examples/rad-self.md b/crates/radicle-cli/examples/rad-self.md index 02c4cb1b..72cd06a1 100644 --- a/crates/radicle-cli/examples/rad-self.md +++ b/crates/radicle-cli/examples/rad-self.md @@ -26,10 +26,14 @@ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi ``` $ rad self --nid -! Warning: The option `--nid` is deprecated, please use `rad node status --only nid` instead. z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi ``` +``` (stderr) +$ rad self --nid +! Deprecated: The command/option `rad self --nid` is deprecated and will be removed. Please use `rad node status --only nid` instead. +``` + ``` $ rad self --ssh-key ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHahWSBEpuT1ESZbynOmBNkLBSnR32Ar4woZqSV2YNH1 diff --git a/crates/radicle-cli/src/commands/self.rs b/crates/radicle-cli/src/commands/self.rs index dbd82b06..04cb11f6 100644 --- a/crates/radicle-cli/src/commands/self.rs +++ b/crates/radicle-cli/src/commands/self.rs @@ -100,9 +100,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> { term::print(profile.config.alias()); } Show::NodeId => { - term::warning( - "The option `--nid` is deprecated, please use `rad node status --only nid` instead.", - ); + crate::warning::deprecated("rad self --nid", "rad node status --only nid"); term::print( Node::new(profile.socket()) .nid()