my urfave/cli version is
v1.22.5
Checklist
Dependency Management
- My project is using go modules.
Describe the bug
The options of SkipFlagParsing: true and CustomHelpTemplate:"..." are not working if there are Subcommands.
To reproduce
package main
import (
"fmt"
"os"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "foo"
app.Commands = []cli.Command{
{
Name: "bar",
SkipFlagParsing: true,
Action: func(c *cli.Context) {
fmt.Println(c.Args())
},
Subcommands: []cli.Command{{
Name: "barfoo",
SkipFlagParsing: true,
Action: func(c *cli.Context) {
fmt.Println(c.Args())
},
},
},
},
}
app.Run(os.Args)
}
Observed behavior
Run:
go build -o skip && ./skip bar --a
Observed behavior:
Incorrect Usage. flag provided but not defined: -a
NAME:
foo bar -
USAGE:
foo bar command [command options] [arguments...]
COMMANDS:
barfoo
OPTIONS:
--help, -h show help
Expected behavior
The output should be:
Additional context
It works if I remove:
Subcommands: []cli.Command{{
Name: "barfoo",
SkipFlagParsing: true,
Action: func(c *cli.Context) {
fmt.Println(c.Args())
},
},
},
my urfave/cli version is
v1.22.5
Checklist
Dependency Management
Describe the bug
The options of
SkipFlagParsing: trueandCustomHelpTemplate:"..."are not working if there are Subcommands.To reproduce
Observed behavior
Run:
Observed behavior:
Expected behavior
The output should be:
Additional context
It works if I remove: