Skip to content

Commit 040fe78

Browse files
authored
Merge pull request #127 from sirhcel/unstable-options
Allow passing unstable options to Cargo
2 parents ddea266 + cec4ab7 commit 040fe78

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

cargo-espflash/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ fn build(
211211
args.extend(features.iter().map(|f| f.as_str()));
212212
}
213213

214+
if let Some(unstable) = build_options.unstable.as_deref() {
215+
for item in unstable.iter() {
216+
args.push("-Z");
217+
args.push(item);
218+
}
219+
}
220+
214221
// Invoke the 'cargo build' command, passing our list of arguments.
215222
let output = Command::new("cargo")
216223
.arg("build")

espflash/src/cli/clap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ pub struct BuildArgs {
2929
/// Target to build for
3030
#[clap(long)]
3131
pub target: Option<String>,
32+
/// Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
33+
#[clap(short = 'Z')]
34+
pub unstable: Option<Vec<String>>,
3235
}
3336

3437
#[derive(Parser)]

0 commit comments

Comments
 (0)