clap
clap copied to clipboard
feat(help): Allow styling for inline context
Allow customizing styling for inline context [default], [possible values], [env], [aliases] and [short aliases]
fix #5093
Hi @epage,
Added the fields inline_context
and inline_context_value
to Styled
.
inline_context_value
is an Option<anstyle::Style>
, and if not explicitly set, will fallback to inline_context
.
The default is simple unstyled as you requested.
I just have one problem with the styling of "Possible Values:" (for enumerated values / multiple choices): For regular help (-h): It's ok, I styled like the others inline contexts case. But for the long_help (--help), currently the enumerated values are already styled with the literal style (see here in code)
For now I left it as it is probabling at least a minor release. It feels a bit incosistent now, and I think I should change the style to inline_context_value.
Let me know if I can add this extra modification.