Skip to content

Commit

Permalink
remove need for use with macro so macro is self contained
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Oct 10, 2024
1 parent f189ec7 commit 3e143cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion cmd/soroban-cli/src/fee.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use clap::arg;
use clap::builder::TypedValueParser;

use crate::assembled::Assembled;
use soroban_env_host::xdr;
Expand Down
22 changes: 10 additions & 12 deletions cmd/soroban-cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,19 @@ pub mod http {
}

pub mod args {
/// Mark argument as deprecated with warning to be printed when it's used. Note: marco is only
/// supported for `bool` and `String` and is required to add
/// ```
/// use clap::builder::TypedValueParser;
/// ```
/// When using the marco
/// Mark argument as deprecated with warning to be printed when it's used.
#[macro_export]
macro_rules! deprecated_arg {
(bool, $message: expr) => {
clap::builder::BoolValueParser::new().map(|x| {
if (x) {
$crate::print::Print::new(false).warnln($message);
}
x
})
<_ as clap::builder::TypedValueParser>::map(
clap::builder::BoolValueParser::new(),
|x| {
if (x) {
$crate::print::Print::new(false).warnln($message);
}
x
},
)
};
}
}
Expand Down

0 comments on commit 3e143cf

Please sign in to comment.