cargo run -p should list valid packages like --bin lists targets #8591
Labels
A-cargo-targets
Area: selection and definition of targets (lib, bins, examples, tests, benches)
A-cli
Area: Command-line interface, option parsing, etc.
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`
Describe the problem you are trying to solve
We have a virtual workspace with multiple sub-projects and tools (a workspace containing an app we need during development). Before introducing features we got used to running
cargo run --bin
, which would then print:Since tools get refactored a lot it was a nice way of seeing all options without too much ceremony. However, after adding features, running
cargo run --bin xxx
does not reliably produce the desired target anymore, butcargo run -p xxx
does, so we tried switching to that one.However, running
cargo bin -p
gives:Describe the solution you'd like
It would be nice if
cargo bin -p
lists all projects it can currently run, similar to how--bin
works.Notes
I don't know if
-p
is more powerful than--bin
in the sense that it accepts binaries outside the virtual workspace. In that case it would be nice to still list all local ones, and maybe note that other targets could be available.The text was updated successfully, but these errors were encountered: