From 5d743a37ea1efca04e8b2d67bdb5faf1fc7fffe9 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 23 Sep 2023 13:42:32 -0700 Subject: [PATCH] Add --config flag --- src/main.rs | 5 +++++ src/opts.rs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index fbdfcd1..a2bce7e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -275,6 +275,11 @@ fn apply_args(cmd: &mut Command, args: &Expand, color: &Coloring, outfile: &Path color => line.arg(color.to_possible_value().unwrap().get_name()), } + for kv in &args.config { + line.arg("--config"); + line.arg(kv); + } + for unstable_flag in &args.unstable_flags { line.arg("-Z"); line.arg(unstable_flag); diff --git a/src/opts.rs b/src/opts.rs index 8225bad..1e85a40 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -40,6 +40,10 @@ pub struct Expand { #[arg(long, value_name = "WHEN")] pub color: Option, + /// Override a configuration value + #[arg(long, value_name = "KEY=VALUE")] + pub config: Vec, + /// Unstable (nightly-only) flags to Cargo #[arg(short = 'Z', value_name = "FLAG")] pub unstable_flags: Vec,