Suggest cargo uninstall
when cargo rm
found nothing but an installed binary with the same name
#11236
Labels
A-diagnostics
Area: Error and warning messages generated by Cargo itself.
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Problem
As
cargo-rm
is going to stabilize, people might make a mistake that usingcargo rm
to uninstall installed binaries. It would be helpful if Cargo guides them to runcargo uninstall
to do a real uninstall.Proposed Solution
The remove happens here. And this is how the result of
cargo install --list
get retrieved.We can make
remove_from_table
return aCargoResult<bool>
to indicate the existence of the given dependency. Then inops::cargo_remove::remove
we can query the installed binary list and make a suggestion like:Notes
If there is already a similar issue, I am sorry and maintainer can close this.
This feature may be too clever. I believe somebody will hit filesystem permission issues and complain
cargo remove
shouldn't touch things outside the current package.Personally, I don't want Cargo starts giving false positive suggestions. If we are not confident in our suggestions, maybe don't give any. (or at least use a less assertive tone)
The text was updated successfully, but these errors were encountered: