Skip to content

Commit

Permalink
chore(cmd): Disable file completions for some subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Sep 16, 2024
1 parent 215d126 commit 8ab32dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/exec/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func New() *cobra.Command {
Args: cobra.NoArgs,
RunE: run,
PreRunE: preRun,

ValidArgsFunction: cobra.NoFileCompletions,
}

flags.JobPodLabels(cmd)
Expand Down
4 changes: 4 additions & 0 deletions cmd/portforward/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func New() *cobra.Command {
}

func localPortCompletion(cmd *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
if len(args) != 0 {
return nil, cobra.ShellCompDirectiveNoFileComp
}

setupOptions.NoSurvey = true
err := preRun(cmd, args)
if err != nil {
Expand Down

0 comments on commit 8ab32dc

Please sign in to comment.