Skip to content

Support not squeezing whitespace #28

Closed
@mgeisler

Description

@mgeisler

We currently split the input string by whitespace and process the words one by one. This implies that we squeeze runs of whitespace to a single space.

We could instead have a mode where whitespace is significant and kept in the output. This would make it possible to wrap text like this line by line:

foobar:    Have lots of foos and bars in the output.
baz:       Show a single bar in the output, but only if it is a full moon.

Lines that wrap would still line up somewhat:

foobar:    Have lots of foos and bars in
the output.
baz:       Show a single bar in the output,
but only if it is a full moon.

In Python's textwrap this option is called replace_whitespace, but I think I'll call it squeeze_whitespace instead. The option should come in handy to support the output wanted in clap-rs/clap#617.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions