Skip to content

Commit

Permalink
Pass args after -- to subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
clubby789 committed Feb 17, 2023
1 parent 4f4c49b commit 67a2533
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ impl Config {

// Set flags.
config.paths = std::mem::take(&mut flags.paths);
config.free_args = std::mem::take(&mut flags.free_args);
config.exclude = flags.exclude.into_iter().map(|path| TaskPath::parse(path)).collect();
config.include_default_paths = flags.include_default_paths;
config.rustc_error_format = flags.error_format;
Expand All @@ -879,7 +880,6 @@ impl Config {
config.keep_stage = flags.keep_stage;
config.keep_stage_std = flags.keep_stage_std;
config.color = flags.color;
config.free_args = flags.free_args.clone().unwrap_or_default();
if matches!(flags.deny_warnings, crate::flags::Warnings::Deny) {
config.deny_warnings = true;
}
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ pub struct Flags {
#[arg(global(true))]
/// paths for the subcommand
pub paths: Vec<PathBuf>,
/// arguments passed to subcommands
#[arg(global(true), last(true), value_name = "ARGS")]
pub free_args: Vec<String>,
}

impl Flags {
Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ impl Step for Miri {
miri.arg("--").arg("--target").arg(target.rustc_target_arg());
miri.args(builder.config.cmd.args());
miri.args(&builder.config.free_args);

// miri tests need to know about the stage sysroot
miri.env("MIRI_SYSROOT", &miri_sysroot);

Expand Down

0 comments on commit 67a2533

Please sign in to comment.