cli icon indicating copy to clipboard operation
cli copied to clipboard

Bash completion doesn't work for subcommands of subcommands

Open tchandelle opened this issue 3 years ago • 3 comments

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 avatar Dec 07 '22 15:12 tchandelle

@tchandelle Can you check if PR fixes your issue ? Thanks

dearchap avatar Dec 07 '22 23:12 dearchap

Thanks @dearchap, that was fast! Yes it works!

tchandelle avatar Dec 08 '22 07:12 tchandelle

@tchandelle v2.23.7 has the fix. Thanks for raising the issue

dearchap avatar Dec 10 '22 15:12 dearchap