-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enhance help texts of position args #11740
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
This looks good to me, but I'm going to r? @epage |
Agree that this is good on its own. Do we want to block closing out the issue on |
I still think #9707 won't go anywhere, given we never knows if |
@bors r+ |
☀️ Test successful - checks-actions |
I'm confused, and maybe I will go try to write my own pull request to resolve my own confusion. But before I go down that path, I want to understand the current situation.
When you say the second suggestion may lead to a false positive, where the second suggestion in question is something covering the following two bullets:
(where perhaps I should have emphasized "one might do" in the above). I'm trying to understand the pro's and con's of suggesting the above to a user, who may not be familiar with the pattern of using Is the problem that concerns you that passing While I don't disagree that what you describe is possible in as a pathological scenario, I think it would solely arise as a pathological case. Someone who is willing to run a misunderstood (or worse yet, untrusted) binary via a blind invocation of Furthermore, ... maybe I misunderstand how So, how is a user going to figure out from the current help output that what they need to do is pass At least the old help output used to include a mention |
Thank you for the reply! My bad I shouldn't rush on this change.
The complete help is embedded in
Yes. From the angle of correctness, I am a bit reluctant to to give an answer that may not exist or not correct. For example, a user runs Another point is why only recommending From the technical aspect, the current help text is, iirc, static. There might be more works to make a dynamic suggestion happen. To make this actionable, we could probably add back a concise version of the old message mentioning |
15 commits in 17b3d0de0897e1c6b8ca347bd39f850bb0a5b9f6..9d5b32f503fc099c4064298465add14d4bce11e6 2023-02-17 19:45:09 +0000 to 2023-02-22 23:04:16 +0000 - refactor(job_queue): docs and move types around (rust-lang/cargo#11758) - Scrub more of the test environment (rust-lang/cargo#11757) - Make more reads of environment variables go through the `Config` (rust-lang/cargo#11754) - Revert "Update curl-sys to use libcurl 7.88.1" (rust-lang/cargo#11755) - use consistent case (rust-lang/cargo#11748) - Switch some tests from `build` to `check` (rust-lang/cargo#11725) - Fix typo in sparse-registry warning message (rust-lang/cargo#11753) - reuse url encoding from `url` crate, don't use separate `percent-encoding` (rust-lang/cargo#11750) - Read environment variables through `Config` instead of `std::env::var(_os)` (rust-lang/cargo#11727) - Update curl-sys to use libcurl 7.88.1 (rust-lang/cargo#11749) - mdman: update pretty_assertions to reduce deps (rust-lang/cargo#11747) - Cleanup tests (rust-lang/cargo#11745) - Enhance help texts of position args (rust-lang/cargo#11740) - Fix typo (rust-lang/cargo#11741) - Update comment about cargo-ok (rust-lang/cargo#11724)
Update cargo 15 commits in 17b3d0de0897e1c6b8ca347bd39f850bb0a5b9f6..9d5b32f503fc099c4064298465add14d4bce11e6 2023-02-17 19:45:09 +0000 to 2023-02-22 23:04:16 +0000 - refactor(job_queue): docs and move types around (rust-lang/cargo#11758) - Scrub more of the test environment (rust-lang/cargo#11757) - Make more reads of environment variables go through the `Config` (rust-lang/cargo#11754) - Revert "Update curl-sys to use libcurl 7.88.1" (rust-lang/cargo#11755) - use consistent case (rust-lang/cargo#11748) - Switch some tests from `build` to `check` (rust-lang/cargo#11725) - Fix typo in sparse-registry warning message (rust-lang/cargo#11753) - reuse url encoding from `url` crate, don't use separate `percent-encoding` (rust-lang/cargo#11750) - Read environment variables through `Config` instead of `std::env::var(_os)` (rust-lang/cargo#11727) - Update curl-sys to use libcurl 7.88.1 (rust-lang/cargo#11749) - mdman: update pretty_assertions to reduce deps (rust-lang/cargo#11747) - Cleanup tests (rust-lang/cargo#11745) - Enhance help texts of position args (rust-lang/cargo#11740) - Fix typo (rust-lang/cargo#11741) - Update comment about cargo-ok (rust-lang/cargo#11724)
What does this PR try to resolve?
Fixes #9707
In #9707, there is an assumption that people tend to run
cargo run --help
and expect it shows the help text of the binary to run. However, the two proposed solution there both may lead to a false positive. I personally don't feel like any of them is a solution we would consider.How should we test and review this PR?
Run each command below and check its help text.