Skip to content
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

Expose helper methods on StyledStr for easy use by consumers #4786

Closed
2 tasks done
pdaoust opened this issue Mar 24, 2023 · 1 comment
Closed
2 tasks done

Expose helper methods on StyledStr for easy use by consumers #4786

pdaoust opened this issue Mar 24, 2023 · 1 comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations S-wont-fix Status: Closed as there is no plan to fix this

Comments

@pdaoust
Copy link

pdaoust commented Mar 24, 2023

Please complete the following tasks

Clap Version

master

Describe your use case

Sometimes there's a desire to create extra help text (e.g., in before_help) that's similar in structure to the autogenerated help text but written by hand. By 'similar in structure' I mean that, for example, headers/literals match the colours of autogenerated headers/literals and multi-line text is wrapped and indented properly.

There's already PR #4765 to allow StyledStr to accept user-styled text and output the proper escape symbols for the execution context. The advantage of using the already existing helpers is that it's durable to changes -- if the maintainers of clap decide to change headers from yellow/uppercase to blue/title-case, the manually written text will change too.

I'd be happy to submit a PR for this, but thought I'd open it as an issue in case discussion should happen first.

Describe the solution you'd like

StyledStr::header(), ::literal(), ::warning(), ::trim(), ::indent(), and so forth are exposed as public members of the impl and are made available to projects that depend on the clap crate.

Alternatives, if applicable

No response

Additional Context

No response

@pdaoust pdaoust added the C-enhancement Category: Raise on the bar on expectations label Mar 24, 2023
@epage
Copy link
Member

epage commented Mar 24, 2023

The existing API won't work when we move forward with #3234, so I'm going to close this as Not Planned,. If there is a reason for us to re-evaluate this, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2023
@epage epage added A-help Area: documentation, including docs.rs, readme, examples, etc... S-wont-fix Status: Closed as there is no plan to fix this labels Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations S-wont-fix Status: Closed as there is no plan to fix this
Projects
None yet
Development

No branches or pull requests

2 participants