Skip to content

Avoid printing trailing whitespace in help output #5074

@djc

Description

@djc

Please complete the following tasks

Clap Version

4.3.21

Describe your use case

In the rustup project, we use the trycmd crate to make sure we don't regress help output. However, while upgrading clap from 3 to 4, I noticed that clap 4 seems to output trailing spaces in some cases:

Screenshot 2023-08-16 at 15 46 14 Screenshot 2023-08-16 at 15 46 30

Personally, I have configured VS Code to files.trimTrailingWhitespace which I believe is helpful in most cases. As such, it has proven to be challenging to fix up the trycmd snapshots.

Describe the solution you'd like

Ideally I think clap should not output trailing whitespace.

Alternatives, if applicable

Do nothing, I guess -- I suppose this is a niche concern.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Raise on the bar on expectations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions