cli/self: `--nid` deprecation warning to stderr

Printing the warning to standard output breaks scripts.

Instead, print to standard error.
This commit is contained in:
Lorenz Leutgeb 2025-09-17 08:27:27 +02:00
parent 3fb04623a4
commit 8558cc2233
No known key found for this signature in database
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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()