diff --git a/CHANGELOG.md b/CHANGELOG.md index c6f3314d..c0afb5e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added - Add `hold-in-reset` and `reset` subcommands +- [cargo-espflash]: Add `--no-default-features` flag to mirror cargo features behavior ## [3.1.0] - 2024-05-24 diff --git a/cargo-espflash/src/main.rs b/cargo-espflash/src/main.rs index 48cdd421..f01d1710 100644 --- a/cargo-espflash/src/main.rs +++ b/cargo-espflash/src/main.rs @@ -128,6 +128,9 @@ struct BuildArgs { /// Comma delimited list of build features #[arg(long, use_value_delimiter = true)] pub features: Option>, + /// Do not activate the `default` feature + #[arg(long)] + pub no_default_features: bool, /// Require Cargo.lock and cache are up to date #[arg(long)] pub frozen: bool, @@ -373,6 +376,9 @@ fn build( .ok_or_else(|| NoTargetError::new(Some(chip)))?; let mut metadata_cmd = MetadataCommand::new(); + if build_options.no_default_features { + metadata_cmd.features(cargo_metadata::CargoOpt::NoDefaultFeatures); + } if let Some(features) = &build_options.features { metadata_cmd.features(cargo_metadata::CargoOpt::SomeFeatures(features.clone())); } @@ -435,6 +441,10 @@ fn build( args.push(package.to_string()); } + if build_options.no_default_features { + args.push("--no-default-features".to_string()); + } + if let Some(features) = &build_options.features { args.push("--features".to_string()); args.push(features.join(","));