From 0d11e9d4fadaf7880e5f4d2ec0575807a852ced7 Mon Sep 17 00:00:00 2001 From: rsteube Date: Tue, 31 Oct 2023 12:14:23 +0100 Subject: [PATCH] git: bugreport --- completers/git_completer/cmd/bugreport.go | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 completers/git_completer/cmd/bugreport.go diff --git a/completers/git_completer/cmd/bugreport.go b/completers/git_completer/cmd/bugreport.go new file mode 100644 index 0000000000..b2dfb46918 --- /dev/null +++ b/completers/git_completer/cmd/bugreport.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var bugreportCmd = &cobra.Command{ + Use: "bugreport", + Short: "Collect information for user to file a bug report", + Run: func(cmd *cobra.Command, args []string) {}, + GroupID: groups[group_interrogator].ID, +} + +func init() { + carapace.Gen(bugreportCmd).Standalone() + + bugreportCmd.Flags().String("diagnose", "", "Create a zip archive of supplemental information about the user’s machine") + bugreportCmd.Flags().Bool("no-diagnose", false, "Create a zip archive of supplemental information about the user’s machine") + bugreportCmd.Flags().StringP("output-directory", "o", "", "Place the resulting bug report file in instead of the current directory") + bugreportCmd.Flags().StringP("suffix", "s", "", "Specify an alternate suffix for the bugreport name") + rootCmd.AddCommand(bugreportCmd) + + bugreportCmd.Flag("diagnose").NoOptDefVal = " " + + carapace.Gen(bugreportCmd).FlagCompletion(carapace.ActionMap{ + "diagnose": carapace.ActionValues("stats", "all"), + "output-directory": carapace.ActionDirectories(), + }) +}