mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
Merge pull request #3531 from epage/feature
fix: Reduce chance of missing `cargo` feature
This commit is contained in:
commit
49559291f0
18 changed files with 44 additions and 1 deletions
|
@ -187,7 +187,6 @@ required-features = ["cargo"]
|
|||
[[example]]
|
||||
name = "02_apps"
|
||||
path = "examples/tutorial_builder/02_apps.rs"
|
||||
required-features = ["cargo"]
|
||||
|
||||
[[example]]
|
||||
name = "02_crate"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command, Command};
|
||||
use std::path::Path;
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command, AppSettings};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command, Command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command, ArgEnum, PossibleValue};
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ArgEnum)]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
use std::ops::RangeInclusive;
|
||||
use std::str::FromStr;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command, ArgGroup};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command, ErrorKind};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Note: this requires the `cargo` feature
|
||||
|
||||
use clap::{arg, command};
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -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…
Reference in a new issue