Skip to content

Allow customizing styling of [default], [possible values], [env] in arg description #5093

Open
@epage

Description

@epage

Please complete the following tasks

Clap Version

4.3.3

Describe your use case

From #3234 (comment)

I cannot find the style to use to change the appearance of the default and possible values. They always appear white. Is that not currently supported?

Screenshot 2023-04-26 at 1 51 01 PM

I understand that this might not be directly related to this issue, so I can open a new one if that's more appropriate.

Describe the solution you'd like

Allow styling to either help it stand out from the rest of the description

Alternatives, if applicable

No response

Additional Context

From #3234 (comment)

Besides naming the styling element for defaults, possible values, and env variables, I'm curious on how people think we should style it.

Some options I thought of:

* `{spec}[default: true]{reset}` (all styled the same)

* `{spec}[default: {literal}true{reset}{spec}]{reset}` (outer-styled, value stuled)

* `[{spec}default:{reset} {literal}true{reset}]` (key-styled, values-styled)

So long as we only use new style definitions, it is not a major or minor breaking change according to our support policy. See https://github.com/clap-rs/clap/blob/master/CONTRIBUTING.md#compatibility-expectations

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-helpArea: documentation, including docs.rs, readme, examples, etc...C-enhancementCategory: Raise on the bar on expectationsS-waiting-on-designStatus: Waiting on user-facing design to be resolved before implementing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions