feat: fields for VisibleFlags name/alias and Usage #2016
Labels
area/v3
relates to / is being considered for v3
status/triage
maintainers still need to look into this
Checklist
What problem does this solve?
When customizing the
AppHelpTemplate
, it would be preferable to change how the first and second column are formatted, ie - the description of the flag on a separate line, tabbed out, and restricted to a width of 80 characters. In the current state of.VisiableFlags
, there is no way to separate the two columns beyond a slice of strings. Each flag has its name and description (.Usage
) clumped together as a single string which is difficult or nearly impossible to parse using go's template actions.Solution description
The two columns should be exposed as separate fields.
For the first column,
.Name
does not truly suffice as it both contains the long Name, Aliases, and has the input values marked by the respective name or alias. A fitting name for this could be.Names
or.Flags
.For the second column, something equivalent to
.Usage
is sufficient.Describe alternatives you've considered
I've tried to loop through
.VisiableFlags
and coerce each flag to its original type such asStingFlag
and then create a custom template to load which would effectively recreate the first column. But this served to be very tedious, and admittedly, I'm not good enough in golang to do this with ease.I also thought of potentially hand writing this part of the help template. But this deemed tedious as well and goes against the spirit of
urfave/cli
as it does not autogenerate based on the visible flags.The text was updated successfully, but these errors were encountered: