diff --git a/cmd/root.go b/cmd/root.go index 3f7eb12..de32991 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -45,6 +45,9 @@ func initRootCmd() { rootCmd.PersistentFlags().BoolVar(&appConfig.OutputOrderReverse, "reverse", false, "Reverses output item order") rootCmd.PersistentFlags().BoolVar(&appConfig.PrintConfig, "print-config", false, "Enable printing the application config") + // Add flag completions + rootCmd.RegisterFlagCompletionFunc("output", cobra.FixedCompletions(formatters, cobra.ShellCompDirectiveNoFileComp)) + // Create logger and add child commands logger := jlog.New(slog.LevelDebug) ctx := jlog.ContextWith(context.Background(), logger)