You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a command has both ValidArgs and sub-commands, the completion script only proposes the ValidArgs. Cobra should do also propose non-hidden sub-commands in the completions list.
To illustrate, in the program below, the rootCmd specifies ValidArgs of rs and ds, but also has a sub-command pod. The bash completion script will only propose the values of ValidArgs and not the sub-commands when both are present. In this case testprog [tab][tab] will not suggest pod because there are ValidArgs.
When a command has both
ValidArgs
and sub-commands, the completion script only proposes theValidArgs
. Cobra should do also propose non-hidden sub-commands in the completions list.I cannot see a reason not to do this...
This was brought up in #1035 (comment)
To illustrate, in the program below, the
rootCmd
specifiesValidArgs
ofrs
andds
, but also has a sub-commandpod
. The bash completion script will only propose the values ofValidArgs
and not the sub-commands when both are present. In this casetestprog [tab][tab]
will not suggestpod
because there areValidArgs
.Program to reproduce:
The text was updated successfully, but these errors were encountered: