cli icon indicating copy to clipboard operation
cli copied to clipboard

Repeated similarly named flags & Before() doesn't go before --help global option.

Open Olimpian opened this issue 5 months ago • 1 comments

A new case to use beforeFun() before --help flag is to set up a language for that help-information. And also it is really strange, that help as a function calls befireFuns(), but help as a flag - is not, imho.

UPDATE: Version: github.com/urfave/cli/v3 v3.3.8 Also, if i add new BoolFlag with Name = "help", it adds without problems. And it is shown in help-message, but you can't call it, cause standard --help is in prior. And you can do it for every command, not only for app. And copied flag several types.

&cli.Command{
	Name: "comand1",
	Flags: []cli.Flag{
		&cli.BoolFlag{
			Name: "help",
		},
		&cli.BoolFlag{
			Name: "help",
		},
	},
}

and if you call app command1 --help you will see:

OPTIONS:
   --help      (default: false)
   --help      (default: false)
   --help, -h  show help

And you can create similarly named flags of any type or name. I think it's a bug...

Originally posted by @Olimpian in #1719

Olimpian avatar Jul 29 '25 17:07 Olimpian

Hi, can I work on this issue?

seipan avatar Aug 19 '25 12:08 seipan