fix(builder): Tell users cargo feature is needed

This will help in cases like #3530
This commit is contained in:
Ed Page 2022-03-03 12:39:42 -06:00
parent 20edbf08f7
commit c6d456f608

View file

@ -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!")]