mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
completion should suggest directories if use contains DIR
This commit is contained in:
@@ -52,6 +52,10 @@ func Complete(cmd *cobra.Command) *complete.Command {
|
||||
Flags: map[string]complete.Predictor{},
|
||||
Sub: map[string]*complete.Command{},
|
||||
}
|
||||
if strings.Contains(cmd.Use, "DIR") {
|
||||
// if usage contains directory, then use a file predictor
|
||||
cc.Args = predict.Dirs("*")
|
||||
}
|
||||
|
||||
// add completion for each subcommand
|
||||
for i := range cmd.Commands() {
|
||||
|
||||
Reference in New Issue
Block a user