Skip to content

Bash completion doesn't work for subcommands of subcommands #1617

@tchandelle

Description

@tchandelle

My urfave/cli version is

github.com/urfave/cli/v2 v2.23.6

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/v2relates to / is being considered for v2kind/bugdescribes or fixes a bugstatus/claimedsomeone has claimed this issuestatus/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