mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
fix(builder): Tell users cargo feature is needed
This will help in cases like #3530
This commit is contained in:
parent
20edbf08f7
commit
c6d456f608
1 changed files with 12 additions and 0 deletions
|
@ -322,6 +322,18 @@ macro_rules! command {
|
|||
}};
|
||||
}
|
||||
|
||||
/// Requires `cargo` feature flag to be enabled.
|
||||
#[cfg(not(feature = "cargo"))]
|
||||
#[macro_export]
|
||||
macro_rules! command {
|
||||
() => {{
|
||||
compile_error!("`cargo` feature flag is required");
|
||||
}};
|
||||
($name:expr) => {{
|
||||
compile_error!("`cargo` feature flag is required");
|
||||
}};
|
||||
}
|
||||
|
||||
/// Deprecated, replaced with [`clap::command!`][crate::command]
|
||||
#[cfg(feature = "cargo")]
|
||||
#[deprecated(since = "3.1.0", note = "Replaced with `clap::command!")]
|
||||
|
|
Loading…
Add table
Reference in a new issue