-
Notifications
You must be signed in to change notification settings - Fork 955
Help for proxy programs should somehow grant a peek behind The Matrix #2285
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
Comments
I guess we could grab the first argument check if it's $ cargo --help
rustup 1.xx.y (blahblah)
Proxy for `cargo`
USAGE:
cargo [+toolchain] ...cargo arguments...
---
Rust's package manager
USAGE:
cargo [OPTIONS] [SUBCOMMAND]
OPTIONS:
-V, --version Print version info and exit
--list List installed commands
...... |
I tried implementing that, but now I think that if you're new, and you don't care about toolchains and you just installed rustup because that's how you're supposed to start with Rust, this looks complicated and scary. So I tried a short line after the normal page, and it looks better to me. But |
Most people won't, if they're new, be using the |
I definitely disagree with that, that's why I came knocking here. There's a lot of "do this" advice out there without a why (and without a searchable keyword). I guess brevity was the point of the short syntax. If you want to be clear, you can use And I have hardly any idea what information is where and what a
|
It strikes me that another approach is for cargo/rustc/rustfmt etc to detect if they're run under rustup and then display some extra help. I wonder if there's a sensible way we could make that happen? |
The original idea I had, was to always pass some secret flag to the cargo/rustc command line, which would somehow contain or refer to the additional help text, without hardcoding that text into cargo/rustc themselves. But rustup might be proxying for an old version of cargo/rustc that complains about an option it doesn't understand, right? So it would have to be yet another environment variable. And it seems pretty hard to make that abstract, and rather easier to hardcode it all into (a module shared by) those two programs. Maybe instead whenever you do "cargo +toolchain build", rustup could first print "performing rustup run toolchain cargo build" unconditionally. That probably wouldn't be appreciated. |
I completely agree that there is a UX issue here. I had patches merged to rustup before I realised the details of it proxying things things. Lets discuss it with the cargo etc teams to see if they have a preference before we do something unilaterally. My proposal to them though, would be that we decorate from rustup with a one-liner before the proxied commands output, because:
If they do do such things and we've done a prefix, worst case, our output is lost or shown on the screen when the user exits, but we haven't prevented the invoked commands UI from working how it chose to work. We may need to have proxied commands that do choose to use man or
|
Uh oh!
There was an error while loading. Please reload this page.
When rustup acts as a proxy (to cargo, rustc, any others?), it does too good a job of hiding itself.
cargo --help
gives no hint to noobs like me that there is somewhere else to look at (likerustup --help
) to understand examples featuring acargo +toolchain
command.cargo --help
, or at leastcargo +stable --help
, should either:Looking at the code, this looks like a non-trivial job for the clap crate to be exploited at src/cli/proxy_mode.rs. Which I'll look into myself, unless someone says it's a bad idea or knows how already.
The text was updated successfully, but these errors were encountered: