cli/warning: Add `fn deprecate`

A helper to print deprecation warnings to stderr.
This commit is contained in:
Lorenz Leutgeb 2025-09-17 08:26:21 +02:00
parent 2635562c92
commit 3fb04623a4
No known key found for this signature in database
1 changed files with 9 additions and 0 deletions

View File

@ -44,3 +44,12 @@ pub(crate) fn nodes_renamed(config: &Config) -> Vec<String> {
));
warnings
}
/// Prints a deprecation warning to standard error.
pub(crate) fn deprecated(old: impl std::fmt::Display, new: impl std::fmt::Display) {
eprintln!(
"{} {} The command/option `{old}` is deprecated and will be removed. Please use `{new}` instead.",
radicle_term::PREFIX_WARNING,
radicle_term::Paint::yellow("Deprecated:").bold(),
);
}