Skip to content

Add -m shorthand for --manifest-path#16858

Merged
weihanglo merged 2 commits intorust-lang:masterfrom
bushrat011899:manifest_path_shorthand
Apr 15, 2026
Merged

Add -m shorthand for --manifest-path#16858
weihanglo merged 2 commits intorust-lang:masterfrom
bushrat011899:manifest_path_shorthand

Conversation

@bushrat011899
Copy link
Copy Markdown
Contributor

What does this PR try to resolve?

How to test and review this PR?

  • In cases where you would expect --manifest-path to work, try -m instead.

Notes

  • First time contributing to cargo so please let me know what I can do to bring this PR up to par if I've missed anything!
  • No AI tooling of any kind was used in the creation of this PR.

@rustbot rustbot added the A-cli Area: Command-line interface, option parsing, etc. label Apr 8, 2026
Comment thread tests/testsuite/short_manifest_path.rs Outdated
@bushrat011899 bushrat011899 force-pushed the manifest_path_shorthand branch from a51fc4e to ecd7aa7 Compare April 9, 2026 01:45
@bushrat011899 bushrat011899 marked this pull request as ready for review April 9, 2026 02:33
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 9, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

Comment thread tests/testsuite/short_manifest_path.rs Outdated
Comment thread tests/testsuite/cargo_add/help/stdout.term.svg
Intended to simplify working with non-standard manifest paths, such as Cargo scripts.
@bushrat011899 bushrat011899 force-pushed the manifest_path_shorthand branch from ecd7aa7 to 53e8ba1 Compare April 9, 2026 03:18
@weihanglo weihanglo added the T-cargo Team: Cargo label Apr 9, 2026
@weihanglo
Copy link
Copy Markdown
Member

@rfcbot fcp merge T-cargo

This insta-stabilizes -m as the shorthand of --manifest-path.

While we have discussed this in team meeting this week (see #16726 (comment)), I feel like an FCP is still needed:

  • For a more formal public record
  • For team members that didn't have time thinking deeper during the meeting

This is a straw poll though. Once it entered 10-day FCP I'll just merge it (of course will wait for beta cutoff)

@rust-rfcbot
Copy link
Copy Markdown
Collaborator

rust-rfcbot commented Apr 9, 2026

Team member @weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Apr 9, 2026
@ehuss ehuss moved this to FCP merge in Cargo status tracker Apr 14, 2026
@rust-rfcbot rust-rfcbot added the final-comment-period FCP — a period for last comments before action is taken label Apr 14, 2026
@rust-rfcbot
Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot rust-rfcbot removed the proposed-final-comment-period An FCP proposal has started, but not yet signed off. label Apr 14, 2026
@weihanglo
Copy link
Copy Markdown
Member

This is a straw poll though. Once it entered 10-day FCP I'll just merge it (of course will wait for beta cutoff)

Merging now

@weihanglo weihanglo added this pull request to the merge queue Apr 15, 2026
@weihanglo
Copy link
Copy Markdown
Member

weihanglo commented Apr 15, 2026

BTW, @bushrat011899 would you mind adding shell completions for zsh and bash in a follow-up PR?

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 15, 2026
@weihanglo weihanglo added this pull request to the merge queue Apr 15, 2026
@bushrat011899
Copy link
Copy Markdown
Contributor Author

BTW, @bushrat011899 would you mind adding shell completions for zsh and bash in a follow-up PR?

I can give it a try! Please see #16888

Merged via the queue into rust-lang:master with commit 0bcac2e Apr 15, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 15, 2026
pull bot pushed a commit to linyihai/cargo that referenced this pull request Apr 15, 2026
…st-lang#16888)

### What does this PR try to resolve?

- Act on [this
request](rust-lang#16858 (comment))
in rust-lang#16858
- `-m` is short for `--manifest-path`, and must be added in places where
`--manifest-path` could be accepted.

### How to test and review this PR?

- Use `zsh`, `bash`, or any other shell where Cargo provides
autocomplete support, and ensure `-m` has identical behaviour to
`--manifest-path`

### Notes

- I've never worked on these autocomplete documents before, so I'm
assuming the modifications I've made are correct based on existing
instances of shorthand (e.g., `-F`)
- ~~Creating as a draft until rust-lang#16858 is merged (which should be very
soon).~~
- No AI tooling of any kind was used during the creation of this PR.
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Apr 18, 2026
Update cargo submodule

26 commits in eb94155a9a60943bd7b1cb04abec42f5d0de6ddc..3bf1388b8823ec4eab622340036593381d8871aa
2026-04-09 13:10:20 +0000 to 2026-04-17 23:27:26 +0000
- Add global HTTP timeout tracking to http_async (rust-lang/cargo#16903)
- feat(config): Stabilize `resolver.lockfile-path` config (rust-lang/cargo#16694)
- chore(deps): update msrv (1 version) to v1.95 (rust-lang/cargo#16897)
- fix: rebuild rustdoc json for different versions of a same crate (rust-lang/cargo#16773)
- Add effective_url to http_async (rust-lang/cargo#16899)
- Make crate downloads process as a queue rather than a stack (rust-lang/cargo#16898)
- fix: sparse registry fetch progress reporting (rust-lang/cargo#16900)
- chore: bump to 0.98.0; update changelog (rust-lang/cargo#16892)
- docs(semver-check): update diagnostics to Rust 1.95 (rust-lang/cargo#16895)
- docs(ref): Better highlight 'package --list' for include/exclude (rust-lang/cargo#16891)
- docs: `include` doesnt apply gitignore from repo (rust-lang/cargo#16890)
- fix: Update `bash` and `zsh` Autocompletion Documents to add `-m` (rust-lang/cargo#16888)
- Add `-m` shorthand for `--manifest-path` (rust-lang/cargo#16858)
- Fix a typo (rust-lang/cargo#16885)
- Always take a shared lock on `.cargo-lock` (rust-lang/cargo#16886)
- fix(toml): Teach users how to pin edition (rust-lang/cargo#16851)
- fix: Prefer defined lint levels over default (rust-lang/cargo#16879)
- chore(deps): bump rand from 0.10.0 to 0.10.1 (rust-lang/cargo#16883)
- fix(lints): Ignore unused_crate_dependencies status (rust-lang/cargo#16877)
- Copy cargo clean target-dir validation tests to clean_new_layout.rs (rust-lang/cargo#16878)
- cargo clean: Add target directory validation (rust-lang/cargo#16712)
- Docs: "api" in the configuration should not include a trailing slash (rust-lang/cargo#16869)
- fix(core): use `closest_msg` to suggest similar member name for mistyped `-p` (rust-lang/cargo#16844)
- chore(ci): Pin GitHub Actions to commit SHAs (rust-lang/cargo#16868)
- chore(ci): Update `actions/checkout` from v5 to v6 (rust-lang/cargo#16867)
- Add test for cargo install with github fastpath (rust-lang/cargo#16866)

r? ghost
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Apr 18, 2026
Update cargo submodule

28 commits in eb94155a9a60943bd7b1cb04abec42f5d0de6ddc..7ecf0285ebb408d596e4a8ac76a0980d8edb7005
2026-04-09 13:10:20 +0000 to 2026-04-18 15:34:11 +0000
- fix: use `portable-atomic` for 64-bit atomics (rust-lang/cargo#16906)
- fix: rename incorrectly documented target-spec-json to json-target-sp… (rust-lang/cargo#16905)
- Add global HTTP timeout tracking to http_async (rust-lang/cargo#16903)
- feat(config): Stabilize `resolver.lockfile-path` config (rust-lang/cargo#16694)
- chore(deps): update msrv (1 version) to v1.95 (rust-lang/cargo#16897)
- fix: rebuild rustdoc json for different versions of a same crate (rust-lang/cargo#16773)
- Add effective_url to http_async (rust-lang/cargo#16899)
- Make crate downloads process as a queue rather than a stack (rust-lang/cargo#16898)
- fix: sparse registry fetch progress reporting (rust-lang/cargo#16900)
- chore: bump to 0.98.0; update changelog (rust-lang/cargo#16892)
- docs(semver-check): update diagnostics to Rust 1.95 (rust-lang/cargo#16895)
- docs(ref): Better highlight 'package --list' for include/exclude (rust-lang/cargo#16891)
- docs: `include` doesnt apply gitignore from repo (rust-lang/cargo#16890)
- fix: Update `bash` and `zsh` Autocompletion Documents to add `-m` (rust-lang/cargo#16888)
- Add `-m` shorthand for `--manifest-path` (rust-lang/cargo#16858)
- Fix a typo (rust-lang/cargo#16885)
- Always take a shared lock on `.cargo-lock` (rust-lang/cargo#16886)
- fix(toml): Teach users how to pin edition (rust-lang/cargo#16851)
- fix: Prefer defined lint levels over default (rust-lang/cargo#16879)
- chore(deps): bump rand from 0.10.0 to 0.10.1 (rust-lang/cargo#16883)
- fix(lints): Ignore unused_crate_dependencies status (rust-lang/cargo#16877)
- Copy cargo clean target-dir validation tests to clean_new_layout.rs (rust-lang/cargo#16878)
- cargo clean: Add target directory validation (rust-lang/cargo#16712)
- Docs: "api" in the configuration should not include a trailing slash (rust-lang/cargo#16869)
- fix(core): use `closest_msg` to suggest similar member name for mistyped `-p` (rust-lang/cargo#16844)
- chore(ci): Pin GitHub Actions to commit SHAs (rust-lang/cargo#16868)
- chore(ci): Update `actions/checkout` from v5 to v6 (rust-lang/cargo#16867)
- Add test for cargo install with github fastpath (rust-lang/cargo#16866)
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Apr 19, 2026
Update cargo submodule

28 commits in eb94155a9a60943bd7b1cb04abec42f5d0de6ddc..7ecf0285ebb408d596e4a8ac76a0980d8edb7005
2026-04-09 13:10:20 +0000 to 2026-04-18 15:34:11 +0000
- fix: use `portable-atomic` for 64-bit atomics (rust-lang/cargo#16906)
- fix: rename incorrectly documented target-spec-json to json-target-sp… (rust-lang/cargo#16905)
- Add global HTTP timeout tracking to http_async (rust-lang/cargo#16903)
- feat(config): Stabilize `resolver.lockfile-path` config (rust-lang/cargo#16694)
- chore(deps): update msrv (1 version) to v1.95 (rust-lang/cargo#16897)
- fix: rebuild rustdoc json for different versions of a same crate (rust-lang/cargo#16773)
- Add effective_url to http_async (rust-lang/cargo#16899)
- Make crate downloads process as a queue rather than a stack (rust-lang/cargo#16898)
- fix: sparse registry fetch progress reporting (rust-lang/cargo#16900)
- chore: bump to 0.98.0; update changelog (rust-lang/cargo#16892)
- docs(semver-check): update diagnostics to Rust 1.95 (rust-lang/cargo#16895)
- docs(ref): Better highlight 'package --list' for include/exclude (rust-lang/cargo#16891)
- docs: `include` doesnt apply gitignore from repo (rust-lang/cargo#16890)
- fix: Update `bash` and `zsh` Autocompletion Documents to add `-m` (rust-lang/cargo#16888)
- Add `-m` shorthand for `--manifest-path` (rust-lang/cargo#16858)
- Fix a typo (rust-lang/cargo#16885)
- Always take a shared lock on `.cargo-lock` (rust-lang/cargo#16886)
- fix(toml): Teach users how to pin edition (rust-lang/cargo#16851)
- fix: Prefer defined lint levels over default (rust-lang/cargo#16879)
- chore(deps): bump rand from 0.10.0 to 0.10.1 (rust-lang/cargo#16883)
- fix(lints): Ignore unused_crate_dependencies status (rust-lang/cargo#16877)
- Copy cargo clean target-dir validation tests to clean_new_layout.rs (rust-lang/cargo#16878)
- cargo clean: Add target directory validation (rust-lang/cargo#16712)
- Docs: "api" in the configuration should not include a trailing slash (rust-lang/cargo#16869)
- fix(core): use `closest_msg` to suggest similar member name for mistyped `-p` (rust-lang/cargo#16844)
- chore(ci): Pin GitHub Actions to commit SHAs (rust-lang/cargo#16868)
- chore(ci): Update `actions/checkout` from v5 to v6 (rust-lang/cargo#16867)
- Add test for cargo install with github fastpath (rust-lang/cargo#16866)
@rustbot rustbot added this to the 1.97.0 milestone Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: Command-line interface, option parsing, etc. disposition-merge FCP with intent to merge final-comment-period FCP — a period for last comments before action is taken T-cargo Team: Cargo

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants