-
Notifications
You must be signed in to change notification settings - Fork 0
Allow styled text in template
#116
Comments
Comment by ssokolow ...and, aesthetics aside, having a |
Comment by danwilliams Equally, if you use, as a guideline, the "full help template" that can be found here: https://github.com/clap-rs/clap/blob/master/tests/example1_tmpl_full.txt ...there is no way to apply the ColoredHelp formatting to the various other headings if, for instance, you wish to change their order or rename them (e.g. for language translations). Unsure at this point of the best approach to getting coloured help output when using custom help templates. |
Comment by ssokolow EDIT: Sorry if you saw the original form of this via e-mail notification. I initially misunderstood the intent of your response. True, but, In my testing, aside from the USAGE: header not being colourized, the template I gave is equivalent to removing the author placeholder from the default template and inserting a newline before
That said, what I'd suggest is some kind of placeholder that resolves to either changing the colour if colourization is enabled or nothing if it's disabled. |
Comment by CreepySkeleton
I was thinking along these lines in the context of clap-rs/clap#1790. Something like
or more generally
And maintain the list of supported colors. I don't want to support any RGB-or-something notations because Windows CMD has only a set of predefined colors and implementing the RGB code => winapi color mapping is something I very much like to avoid. |
Comment by pksunkara The original |
Issue by ssokolow
Tuesday Mar 19, 2019 at 00:17 GMT
Originally opened as clap-rs/clap#1433
Rust Version
rustc 1.32.0 (9fda7c223 2019-01-16)
Affected Version of clap
2.32.0
Bug or Feature Request Summary
When using a custom template to work around papercuts in Clap (#1432) and StructOpt (TeXitoi/structopt#172) which break
help2man
, i can find no documented way to applyAppSettings::ColoredHelp
to the "USAGE:" header, though I've managed to reconstruct the desired bits of all of the rest of the default template.Expected Behavior Summary
I should have some means of reintroducing the conditionally and portably colored
USAGE:
header, like this:NOTE: Image created as a composite of two screenshots.
Actual Behavior Summary
I was able to recreate every desired element of the default template except the coloring on the
USAGE:
header:Steps to Reproduce the issue
AppSettings::ColoredHelp
:Sample Code or Link to Sample Code
https://gist.github.com/ssokolow/9df8c92b24d94116c5eb57fccad2b1a2
The text was updated successfully, but these errors were encountered: