Open Amaury-Behague opened 2 weeks ago
@Amaury-Behague You can set a custom template and override whatever you want in the help text. It is not very user friendly but anyone with a knowledge of go templating should be able to handle it. At this point v2 is in maint mode so we cannot make any changes to the current behavior. If you have an ideas we can incorporate them into v3.
My urfave/cli version is
v2.27.2
Checklist
Dependency Management
Describe the bug
This line of the code doesn't allow to set an empty
cli.App.Usage
value, which together with the fact thathelpNameTemplate
is not configurable makes it hard to have a cleanHELP:
section in the CLI docs. https://github.com/urfave/cli/blob/1210bdf785b2bddda680a262acc84d5e7b583460/command.go#L203To reproduce
Create a
cli.App{Usage: ""}
orcli.App{}
struct and launch it with--help
.Observed behavior
It's not possible to remove the
"A new cli application"
string from the help. SettingUsage
to" "
also leaves the-
. The only way I've found is to entirely overridecli.AppHelpTemplate
or setUsage: "\b\b "
.Expected behavior
I would like to be able to set
Usage
to""
without it being overridden, or at least be able to customizehelpNameTemplate
to be able to remove the part that usesUsage
.Want to fix this yourself?
We'd love to have more contributors on this project! If the fix for this bug is easily explained and very small, feel free to create a pull request for it.
Run
go version
and paste its output hereRun
go env
and paste its output here