Expose helper methods on StyledStr
for easy use by consumers
#4786
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
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 theclap
crate.Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: