Skip to content

Commit bad04b4

Browse files
bors[bot]zachs18
andauthored
Merge #1049
1049: Stop parsing arguments to `cross run` after `--`. r=Emilgardis a=zachs18 Resolves #1048. Stop parsing arguments to `cross run` after `--`, but still add them to `args.all` so they will be passed to the program being run. Co-authored-by: Zachary S <zasample18+github@gmail.com>
2 parents 2c2a65e + 203a4e8 commit bad04b4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changes/1049.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "changed",
3+
"description": "stop parsing arguments to `cross run` after `--`",
4+
"issues": [1048]
5+
}

src/cli.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ pub fn parse(target_list: &TargetList) -> Result<Args> {
175175
if arg.is_empty() {
176176
continue;
177177
}
178-
if let v @ 1.. = is_verbose(arg.as_str()) {
178+
if matches!(arg.as_str(), "--") {
179+
all.push(arg);
180+
all.extend(args.by_ref());
181+
} else if let v @ 1.. = is_verbose(arg.as_str()) {
179182
verbose += v;
180183
all.push(arg);
181184
} else if matches!(arg.as_str(), "--version" | "-V") {

0 commit comments

Comments
 (0)