Skip to content

CustomHelpTemplate is ignored with --help flag #1703

@feedmeapples

Description

@feedmeapples

My urfave/cli version is

2.25.0

Checklist

  • Are you running the latest v2 release? The list of releases is here.
  • Did you check the manual for your release? The v2 manual is here
  • Did you perform a search about this problem? Here's the GitHub guide about searching.

Dependency Management

  • My project is using go modules.
  • My project is automatically downloading the latest version.

Describe the bug

While cli top-level-command help respects CustomHelpTemplate when printing help, cli top-level-command --help ignores it and prints SubcommandHelpTemplate instead.

Is this intentional? What is the purpose of SubcommandHelpTemplate?

If this is not intentional i can send a PR switching to CustomHelpTemplate

To reproduce

app := cli.NewApp()
	app.Name = "testapp"
        app.Commands = []*cli.Command{
		        {
			        Name:   "top-level-command",
			        Action: func(c *cli.Context) error { return nil },
			        CustomHelpTemplate: "TESTING",
			 }
}
go run ./cmd/app top-level-command --help

Observed behavior

It prints SubcommandHelpTemplate

Expected behavior

go run ./cmd/app top-level-command --help should print CustomHelpTemplate

Additional context

temporalio/cli#153

Want to fix this yourself?

Yes

Run go version and paste its output here

go version

Run go env and paste its output here

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/v2relates to / is being considered for v2kind/bugdescribes or fixes a bugstatus/triagemaintainers still need to look into this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions