Skip to content

--help output should use line wrapping #11895

@w-flo

Description

@w-flo

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 in cargo 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 the wrap_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

Metadata

Metadata

Assignees

Labels

A-cli-helpArea: built-in command-line helpA-console-outputArea: Terminal output, colors, progress bar, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions