Skip to content

Commit

Permalink
Merge pull request #197 from dtolnay/config
Browse files Browse the repository at this point in the history
Add `--config` flag
  • Loading branch information
dtolnay authored Sep 23, 2023
2 parents 0e6dc7f + 5d743a3 commit cb13222
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pub struct Expand {
#[arg(long, value_name = "WHEN")]
pub color: Option<Coloring>,

/// Override a configuration value
#[arg(long, value_name = "KEY=VALUE")]
pub config: Vec<String>,

/// Unstable (nightly-only) flags to Cargo
#[arg(short = 'Z', value_name = "FLAG")]
pub unstable_flags: Vec<String>,
Expand Down

0 comments on commit cb13222

Please sign in to comment.