Skip to content

Commit

Permalink
remove completeOutputFormat function
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLiu1123 committed Sep 22, 2024
1 parent c6071cd commit e79d379
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/cmd/introspect/introspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ func NewCmdIntrospect(globalOptions *model.GlobalOptions) *cobra.Command {

cmd.Flags().StringVarP(&opt.config, "config", "f", globalOptions.Config, "Config file to use")
cmd.Flags().StringVarP(&opt.output, "output", "o", "json", "Output format, one of (json, yaml)")
_ = cmd.RegisterFlagCompletionFunc("output", completeOutputFormat)

_ = cmd.RegisterFlagCompletionFunc("output", func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{"json", "yaml"}, cobra.ShellCompDirectiveNoFileComp
})

return cmd
}
Expand All @@ -47,10 +50,6 @@ func validateArgs(_ *cobra.Command, args []string) {
}
}

func completeOutputFormat(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
return []string{"json", "yaml"}, cobra.ShellCompDirectiveNoFileComp
}

func run(_ *cobra.Command, _ []string, opt *introspectOptions, _ *model.GlobalOptions) {
renderContexts := sync.OnceValue(func() []*model.RenderContext {
cfg, err := util.ReadConfig(opt.config)
Expand Down

0 comments on commit e79d379

Please sign in to comment.