cli
cli copied to clipboard
Bash completion doesn't work for subcommands of subcommands
My urfave/cli version is
github.com/urfave/cli/v2 v2.23.6
Checklist
- [x] Are you running the latest v2 release? The list of releases is here.
- [x] Did you check the manual for your release? The v2 manual is here
- [x] Did you perform a search about this problem? Here's the GitHub guide about searching.
Dependency Management
- My project is using go modules.
Describe the bug
Bash completion (arg --generate-bash-completion and option EnableBashCompletion) does not provide completion for subcommands of subcommands.
To reproduce
https://go.dev/play/p/aO7adBNLVCf
Observed behavior
It returns commands below alpha.
$ ./app alpha beta --generate-bash-completion
beta
help
h
Expected behavior
It should returns commands below beta (ie. gamma)
$ ./app alpha beta --generate-bash-completion
gamma
help
h
Run go version and paste its output here
$ go version
go version go1.18.8 darwin/amd64
@tchandelle Can you check if PR fixes your issue ? Thanks
Thanks @dearchap, that was fast! Yes it works!
@tchandelle v2.23.7 has the fix. Thanks for raising the issue