-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Shorthand for --manifest-path #16726
Copy link
Copy link
Labels
A-cliArea: Command-line interface, option parsing, etc.Area: Command-line interface, option parsing, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewZ-scriptNightly: cargo scriptNightly: cargo script
Metadata
Metadata
Assignees
Labels
A-cliArea: Command-line interface, option parsing, etc.Area: Command-line interface, option parsing, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewZ-scriptNightly: cargo scriptNightly: cargo script
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
When experimenting with Cargo scripts (see #12207), it's expected that a user will need to specify the script using
--manifest-pathfor the various applicablecargosubcommands (add,fix, etc.). This is quite verbose, for example:While this is most noticeable with scripts, the verbosity is still applicable outside that context. As such, I believe this issue can be examined independently.
Proposed Solution
I believe
-mor-Mwould be an appropriate shorthand to add to the applicable subcommands, as an example:I've made commit here which adds the shorthand and tests to ensure the shorthand works as expected across all commands that currently have a
--manifest-pathflag. Notably missing is updates to relevant documentation, as this is my first attempt at working on Cargo and I'm not totally sure what the recommended way to update it would be.Notes
src\etc\cargo.bashcomp.sh, only--manifest-pathand--message-formatbegin with the lettermout of all possible flags across all commands. Since--message-formatis only applicable in 3 commands, while--manifest-pathis applicable in 22, I'd argue the chance for ambiguity is very low.--jobshas a shorthand of-j,--featuresinstead uses-F. I'm not sure what (if any) pattern is used to choose lowercase vs capital shorthands, so I elected to use-min the above example arbitrarily.--manifest-pathshorthand, but please let me know if there is one I missed!