Skip to content

Have mocked cargo better adhere to cargo conventions #4203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

smoelius
Copy link
Contributor

@smoelius smoelius commented Mar 1, 2025

Currently, when the mocked cargo command is passed --recursive-cargo-subcommand, it runs:

cargo-foo --recursive-cargo

However, cargo subcommands are normally passed their subcommand name as the first argument. Thus, one would expect the following to be run:

cargo-foo foo --recursive-cargo

This commit changes the mocked cargo command to do the latter. It also adds a check to ensure that the "subcommand name as first argument" behavior is respected.

This is, admittedly, a rather pedantic change.

Extracted from #4175

Currently, when the mocked cargo command is passed
`--recursive-cargo-subcommand`, it runs:

```
cargo-foo --recursive-cargo
```

However, cargo subcommands are normally passed their subcommand name as
the first argument. Thus, one would expect the following to be run:

```
cargo-foo foo --recursive-cargo
```

This commit changes the mocked cargo command to do the latter. It also
adds a check to ensure that the "subcommand name as first argument"
behavior is respected.

This is, admittedly, a rather pedantic change.

Extracted from rust-lang#4175
Copy link
Member

@rami3l rami3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@rami3l rami3l added this pull request to the merge queue Mar 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 2, 2025
@rami3l rami3l added this pull request to the merge queue Mar 2, 2025
Merged via the queue into rust-lang:master with commit 6744fb5 Mar 2, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants