diff --git a/cmd/completion.go b/cmd/completion.go new file mode 100644 index 0000000..cf32d23 --- /dev/null +++ b/cmd/completion.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/spf13/cobra" + "os" +) + +func init() { + rootCmd.AddCommand(completionCommand) +} + +var completionCommand = &cobra.Command{ + Use: "completion", + Short: "generates a bash autocomplete script", + RunE: func(cmd *cobra.Command, args []string) error { + return rootCmd.GenBashCompletion(os.Stdout) + }, +}