mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
Make cargo feature additive
This commit is contained in:
parent
cb29d1d547
commit
47782cfac6
4 changed files with 9 additions and 7 deletions
|
@ -61,5 +61,6 @@ stages:
|
|||
rmdir /Q /S target\.rustc_info.json
|
||||
rmdir /Q /S target\debug\examples
|
||||
rmdir /Q /S target\debug\incremental
|
||||
rmdir /Q /S target\tests\target\debug\incremental
|
||||
displayName: Cleaning for cache
|
||||
continueOnError: true
|
||||
|
|
|
@ -35,6 +35,7 @@ jobs:
|
|||
- {}
|
||||
- rust: beta
|
||||
- rust: nightly
|
||||
cache: false
|
||||
- name: Linting (fmt + clippy)
|
||||
before_script:
|
||||
- rustup component add clippy
|
||||
|
|
|
@ -81,14 +81,14 @@ version-sync = "0.8"
|
|||
criterion = "0.3"
|
||||
|
||||
[features]
|
||||
default = ["suggestions", "color", "vec_map", "derive", "std"]
|
||||
default = ["suggestions", "color", "vec_map", "derive", "std", "cargo"]
|
||||
std = [] # support for no_std in a backwards-compatible way
|
||||
suggestions = ["strsim"]
|
||||
color = ["ansi_term", "atty"]
|
||||
wrap_help = ["term_size", "textwrap/term_size"]
|
||||
derive = ["clap_derive", "lazy_static"]
|
||||
yaml = ["yaml-rust"]
|
||||
no_cargo = [] # Enable if you're not using Cargo, disables Cargo-env-var-dependent macros
|
||||
cargo = [] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros
|
||||
unstable = [] # for building with unstable clap features (doesn't require nightly Rust) (currently none)
|
||||
nightly = [] # for building with unstable Rust features (currently none)
|
||||
debug = [] # Enables debug messages
|
||||
|
|
|
@ -426,7 +426,7 @@ macro_rules! arg_enum {
|
|||
/// .get_matches();
|
||||
/// # }
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_cargo"))]
|
||||
#[cfg(feature = "cargo")]
|
||||
#[macro_export]
|
||||
macro_rules! crate_version {
|
||||
() => {
|
||||
|
@ -455,7 +455,7 @@ macro_rules! crate_version {
|
|||
/// .get_matches();
|
||||
/// # }
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_cargo"))]
|
||||
#[cfg(feature = "cargo")]
|
||||
#[macro_export]
|
||||
macro_rules! crate_authors {
|
||||
($sep:expr) => {{
|
||||
|
@ -515,7 +515,7 @@ macro_rules! crate_authors {
|
|||
/// .get_matches();
|
||||
/// # }
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_cargo"))]
|
||||
#[cfg(feature = "cargo")]
|
||||
#[macro_export]
|
||||
macro_rules! crate_description {
|
||||
() => {
|
||||
|
@ -536,7 +536,7 @@ macro_rules! crate_description {
|
|||
/// .get_matches();
|
||||
/// # }
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_cargo"))]
|
||||
#[cfg(feature = "cargo")]
|
||||
#[macro_export]
|
||||
macro_rules! crate_name {
|
||||
() => {
|
||||
|
@ -567,7 +567,7 @@ macro_rules! crate_name {
|
|||
/// let m = app_from_crate!().get_matches();
|
||||
/// # }
|
||||
/// ```
|
||||
#[cfg(not(feature = "no_cargo"))]
|
||||
#[cfg(feature = "cargo")]
|
||||
#[macro_export]
|
||||
macro_rules! app_from_crate {
|
||||
() => {
|
||||
|
|
Loading…
Reference in a new issue