-
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
Quest issue: how can we improve --help output #6104
Comments
I've been wanting to write more extensive documentation for each command, but I'm uncertain where it should live. I fear putting it in the |
I'm personally fond of For more long-form documentation though I think using HTML docs is probably better, and I think we could also place urls to those documentation as well perhaps? |
It's a bit tricky to do that in clap, but it should be possible. I can put together a prototype to see what it looks like. |
Could also include those files with the cargo install and support something like |
Seems plausible to me! |
@joshtriplett Here is the option grouping support in clap v3: https://github.com/clap-rs/clap/blob/eaa0700e7ed76f37d245a6878deb3b8e81754d6c/src/build/app/mod.rs#L645-L651 and what it looks like: https://github.com/clap-rs/clap/blob/eaa0700e7ed76f37d245a6878deb3b8e81754d6c/tests/help.rs#L1395-L1416 It's not clear to me what's going on with clap 3. It looks like there's a lot of good stuff, but there hasn't been much progress recently. I looked at implementing |
I believe we should bold the |
If you specify |
@pksunkara It removes the cargo/src/bin/cargo/commands/build.rs Line 8 in 805462e
|
Improve feature discovery of help message Inspired by x.py help rust-lang/rust#71357 Improves #6104
Show alias in help message Improve feature discovery of help message Inspired by x.py help rust-lang/rust#71357 Improves #6104
Display embedded man pages for built-in commands. This changes `cargo help COMMAND` to display the man page for the given command. `cargo COMMAND --help` continues to show the basic clap output. The man pages are embedded in the executable in a compressed format. There's also a copy of the man pages in text format for platforms that do not have the `man` executable (like Windows). It is unfortunate to check in more pre-generated files. I hope in the future that the usage of asciidoc can be replaced with something else (possibly a custom markdown-based solution). cc #6104
As an update on this issue, clap 3 is out with help heading support. It should be relatively easy to jump start cargo with this because the man pages are already organized into sections. As for brief vs verbose help, I don't think a separate flag is needed.
There already exists a pattern that |
Several people from local communities report that Cargo doesn't have a good command line help text, but it turns out that they don't even know the existence of |
If cargo wants to go the git route of A CLI can create separate When clap maintainers created |
IIRC I mentioned this in another issue. One possible downside is the lack of global man pages, which breaks fish alt+h and also breaks if user tried The For me, I rather have the default stable toolchain as the global man page and then in the man page mention a big To browse man page for current toolchain use |
|
$ cargo add -h
...
-h, --help Print help (see more with '--help')
...
$ cargo add --help
...
-h, --help
Print help (see a summary with '-h')
... Then with #12578, we've added styling to highlight the suggestion to run Between these and previous changes, I'm not seeing much more we can/should do for this and would recommend we track further improvements in more specific, individual issues. |
This is a tracking issue for figuring out how to make the output
cargo $subcommand --help
more useable. We discussed this at the cargo team meeting today and a few ideas we had:--help -Z unstable-options
. Hide unstable options from --help without -Z unstable-options #6102--help --verbose
Other ideas appreciated! Also appreciated would be any PRs to make the wording of help output clearer or more concise.
The text was updated successfully, but these errors were encountered: