Allow specifying --package
before the subcommand
#14858
Labels
A-cli
Area: Command-line interface, option parsing, etc.
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-propose-close
Status: A team member has nominated this for closing, pending further input from the team
Problem
Sometimes I am developing a specific crate within a workspace, and development workflow consists of a handful of subcommands for that same crate:
cargo test --package some-package cargo clippy --package some-package --all-targets cargo add --package some-package serde
This is mildly cumbersome in terminal because in order to change the subcommand, the cursor needs to be moved around
--package some-package
(or-p
).Proposed Solution
It would be nice if
--package
could be passed to the rootcargo
command, and then be used by any subcommands:This makes it a bit easier to work with since there is a "base command" for whatever crate is being worked on, and then the trailing subcommand is easier to change. The alignment also makes things somewhat nicer to read in scripts.
Notes
This would make
--package
somewhat analogous to the unstable-C
, which is a good thing in my opinion (workflows with other tooling that supports-C
is often similar with a base command / subcommand split).The text was updated successfully, but these errors were encountered: