Make cargo feature additive

This commit is contained in:
Pavan Kumar Sunkara 2020-03-01 22:55:57 +01:00
parent cb29d1d547
commit 47782cfac6
4 changed files with 9 additions and 7 deletions

View file

@ -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

View file

@ -35,6 +35,7 @@ jobs:
- {}
- rust: beta
- rust: nightly
cache: false
- name: Linting (fmt + clippy)
before_script:
- rustup component add clippy

View file

@ -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

View file

@ -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 {
() => {