-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(doc): doc for custom subcommands look up. #13203
Conversation
r? @weihanglo (rustbot has picked a reviewer for you, use r? to override) |
@@ -265,6 +265,12 @@ cargo `(?<command>[^ ]+)` into an invocation of an external tool | |||
`cargo-${command}`. The external tool must be present in one of the user's | |||
`$PATH` directories. | |||
|
|||
> Note: Cargo looks for custom subcommands in `$PATH `and then `$CARGO_HOME/bin`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a bit incorrect. I may emphasize two things:
- By default, tools in
$CARGO_HOME/bin
take precedence over tools in$PATH
. - Users can put
$CARGO_HOME/bin
in$PATH
to control the precedence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, tools in $CARGO_HOME/bin take precedence over tools in $PATH.
Yes, Indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've polished the description to the best of my ability, hoping to get it right.
0b819ba
to
0dc45b4
Compare
> Note: By default, Cargo invokes custom subcommand in `$CARGO_HOME/bin` | ||
> instead of `$PATH`. If you want to change this behavior, you can put | ||
> `$CARGO_HOME/bin` in `$PATH` to control the precedence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"instead of" doesn't convey the precedence. How about this?
> Note: By default, Cargo invokes custom subcommand in `$CARGO_HOME/bin` | |
> instead of `$PATH`. If you want to change this behavior, you can put | |
> `$CARGO_HOME/bin` in `$PATH` to control the precedence. | |
> **Note**: Cargo defaults to prioritizing external tools in `$CARGO_HOME/bin` | |
> over `$PATH`. Users can override this precedence by adding `$CARGO_HOME/bin` | |
> to `$PATH`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used what you suggested and it looks pretty good without any grammar problems
0dc45b4
to
d71b2bc
Compare
Thank you :) @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 7 commits in ac6bbb33293d8d424c17ecdb42af3aac25fb7295..ef94adb92704acf3967be8cf73ac0b01d818c47a 2023-12-26 23:22:08 +0000 to 2023-12-31 02:20:45 +0000 - cleanup: Remove error-format special-case in `cargo fix` (rust-lang/cargo#13224) - `cargo fix`: always inherit the jobserver (rust-lang/cargo#13225) - Bump cargo-credential to 0.4.3 (rust-lang/cargo#13221) - `cargo add` - fix for adding features from repository with multiple packages. (rust-lang/cargo#13213) - Remove repetitive words (rust-lang/cargo#13216) - Add cargo:rustc-cdylib-link-arg into RESERVED_PREFIXES list (rust-lang/cargo#13212) - chore(doc): doc for custom subcommands look up. (rust-lang/cargo#13203) r? ghost
Update cargo 11 commits in ac6bbb33293d8d424c17ecdb42af3aac25fb7295..add15366eaf3f3eb84717d3b8b71902ca36a7c84 2023-12-26 23:22:08 +0000 to 2024-01-02 03:24:42 +0000 - chore(deps): update gix (rust-lang/cargo#13230) - chore(deps): update alpine docker tag to v3.19 (rust-lang/cargo#13228) - rustfix: Support inserting new lines. (rust-lang/cargo#13226) - Fix fix::fix_in_dependency to not rely on rustc (rust-lang/cargo#13220) - cleanup: Remove error-format special-case in `cargo fix` (rust-lang/cargo#13224) - `cargo fix`: always inherit the jobserver (rust-lang/cargo#13225) - Bump cargo-credential to 0.4.3 (rust-lang/cargo#13221) - `cargo add` - fix for adding features from repository with multiple packages. (rust-lang/cargo#13213) - Remove repetitive words (rust-lang/cargo#13216) - Add cargo:rustc-cdylib-link-arg into RESERVED_PREFIXES list (rust-lang/cargo#13212) - chore(doc): doc for custom subcommands look up. (rust-lang/cargo#13203)
What does this PR try to resolve?
as the #13194 metions, the lookup rules for custom subcommands are only reflected in comments inside the code, and it is time to inform users of this behavior through documentation.
How should we test and review this PR?
Additional information