-
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
--help
output should use line wrapping
#11895
Comments
Thanks for the suggestion! Could you provide some screenshots as references? That would help people compare and evaluate different methods. 🙏 |
That's a great idea, @weihanglo! Here's the current situation, using (I believe) the default Ubuntu terminal, which is gnome-terminal, and the default terminal size: And this is how it looks with the After enabling this feature, the line length will increase/decrease depending on the terminal width. In full-screen console windows, that might be too much, as it's easier to read text that wraps at maybe column 80 or 100, instead of 200. There's According to |
Wow! Really appreciate such a detailed response. Thank you!! And yep, we pay a bit more attention when pulling new dependencies. Your I am not sure if we want to set The only drawback I am aware of is that people lose the ability to copy the entire description of an option as a sentence without extra steps. They will need to remove leading/trailing whitespaces if enabling the feature. |
No problem pulling it in. When doing the upgrade, I considered adding btw in clap v5, I'm looking to change the fallback terminal width to being a max terminal width, see clap-rs/clap#4295 |
@rustbot claim. I'm willing to try to solve it. |
Problem
In cargo 1.68.1, maybe since the clap v4 upgrade (#11159), help text in
--help
output is not wrapping. This looks bad for example incargo init --help
, because the help text for--vcs
is pretty long and it just wraps at the terminal emulator line end without respecting word boundaries.Maybe the
wrap_help
feature of clap should be enabled? AIUI, it pulls in a new dependency, but the possibility to wrap at a fixed width (e.g. 80 chars) was dropped in clap v3.[max_]term_width
functions apparently exist, but they don't work when thewrap_help
feature is disabled, which it is by default (or maybe I'm misunderstanding this issue).Proposed Solution
Probably enable the clap
wrap_help
feature, or maybe downgrade to clap v3 and set a fixed wrap width of e.g. 80 characters if the additional dependency is too heavy / unwanted.Notes
No response
The text was updated successfully, but these errors were encountered: