Skip to content

Conversation

@motorailgun
Copy link
Contributor

@motorailgun motorailgun commented Jun 13, 2025

fix #15656

What does this PR try to resolve?

This PR implements custom TAB completer for cargo remove <package_name>.

How to test and review this PR?

This patch works like this:

$ cat Cargo.toml
[package]
name = "sandbox"
version = "0.1.0"
edition = "2024"

[dependencies]
rand = "0.9.1"
serde_json = "1"

$ ~/cargo/target/debug/cargo remove 
completing values
--build          -- Remove from build-dependencies
--color          -- Coloring
--config         -- Override a configuration value
--dev            -- Remove from dev-dependencies
--dry-run        -- Don't actually write the manifest
--frozen         -- Equivalent to specifying both --locked and --offline
--help           -- Print help
--locked         -- Assert that `Cargo.lock` will remain unchanged
--lockfile-path  -- Path to Cargo.lock (unstable)
--manifest-path  -- Path to Cargo.toml
--offline        -- Run without accessing the network
--package        -- Package to remove from
--quiet          -- Do not print cargo log messages
--target         -- Remove from target-dependencies
--verbose        -- Use verbose output (-vv very verbose/build.rs output)
-Z               -- Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
rand        serde_json

(on zsh)

@rustbot
Copy link
Collaborator

rustbot commented Jun 13, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
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

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. Command-remove S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 13, 2025
@motorailgun motorailgun force-pushed the autocomplete-cargo-remove branch 2 times, most recently from 7b4442f to 96c31a7 Compare June 14, 2025 11:43
@motorailgun motorailgun requested a review from epage June 14, 2025 12:03
@motorailgun motorailgun force-pushed the autocomplete-cargo-remove branch from 96c31a7 to 72e90fa Compare June 16, 2025 21:26
@epage
Copy link
Contributor

epage commented Jun 16, 2025

Thanks!

@epage epage enabled auto-merge June 16, 2025 21:28
@epage epage added this pull request to the merge queue Jun 16, 2025
Merged via the queue into rust-lang:master with commit 2251525 Jun 16, 2025
24 checks passed
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 17, 2025
Update cargo

6 commits in fc1518ef02b77327d70d4026b95ea719dd9b8c51..2251525ae503fa196f6d7f9ce6d32eccb2d5f044
2025-06-06 04:49:44 +0000 to 2025-06-16 22:01:27 +0000
- feat: Add custom completer for `cargo remove &lt;TAB&gt;` (rust-lang/cargo#15662)
- chore(deps): update msrv (3 versions) to v1.85 (rust-lang/cargo#15668)
- refactor: replace InternedString with Cow in IndexPackage (rust-lang/cargo#15559)
- highlight the correct words (rust-lang/cargo#15659)
- CHANGELOG.md: typo (rust-lang/cargo#15660)
- Use `Not::not` rather than a custom `is_false` function (rust-lang/cargo#15645)
@rustbot rustbot modified the milestone: 1.89.0 Jun 18, 2025
rust-timer added a commit to rust-lang/rust that referenced this pull request Jun 18, 2025
Rollup merge of #142632 - ehuss:update-cargo, r=ehuss

Update cargo

6 commits in fc1518ef02b77327d70d4026b95ea719dd9b8c51..2251525ae503fa196f6d7f9ce6d32eccb2d5f044
2025-06-06 04:49:44 +0000 to 2025-06-16 22:01:27 +0000
- feat: Add custom completer for `cargo remove &lt;TAB&gt;` (rust-lang/cargo#15662)
- chore(deps): update msrv (3 versions) to v1.85 (rust-lang/cargo#15668)
- refactor: replace InternedString with Cow in IndexPackage (rust-lang/cargo#15559)
- highlight the correct words (rust-lang/cargo#15659)
- CHANGELOG.md: typo (rust-lang/cargo#15660)
- Use `Not::not` rather than a custom `is_false` function (rust-lang/cargo#15645)
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. Command-remove S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autocomplete cargo remove with installed dependencies

4 participants