From c042eb72841e95b622f7c6d56670dc7255783f04 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sun, 29 Oct 2023 23:13:45 +0100 Subject: [PATCH] git: mailinfo --- completers/git_completer/cmd/mailinfo.go | 34 +++++++++++++++++++ .../git_completer/cmd/mailinfo_generated.go | 19 ----------- 2 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 completers/git_completer/cmd/mailinfo.go delete mode 100644 completers/git_completer/cmd/mailinfo_generated.go diff --git a/completers/git_completer/cmd/mailinfo.go b/completers/git_completer/cmd/mailinfo.go new file mode 100644 index 0000000000..a8b908c548 --- /dev/null +++ b/completers/git_completer/cmd/mailinfo.go @@ -0,0 +1,34 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var mailinfoCmd = &cobra.Command{ + Use: "mailinfo", + Short: "Extracts patch and authorship from a single e-mail message", + Run: func(cmd *cobra.Command, args []string) {}, + GroupID: groups[group_low_level_helper].ID, +} + +func init() { + carapace.Gen(mailinfoCmd).Standalone() + + mailinfoCmd.Flags().BoolS("b", "b", false, "keep non patch brackets in subject") + mailinfoCmd.Flags().BoolS("k", "k", false, "keep subject") + mailinfoCmd.Flags().BoolP("message-id", "m", false, "copy Message-ID to the end of commit message") + mailinfoCmd.Flags().BoolS("n", "n", false, "disable charset re-coding of metadata") + mailinfoCmd.Flags().String("quoted-cr", "", "action when quoted CR is found") + mailinfoCmd.Flags().Bool("scissors", false, "use scissors") + mailinfoCmd.Flags().BoolS("u", "u", false, "re-code metadata to i18n.commitEncoding") + rootCmd.AddCommand(mailinfoCmd) + + carapace.Gen(mailinfoCmd).FlagCompletion(carapace.ActionMap{ + "quoted-cr": carapace.ActionValuesDescribed( + "nowarn", "Git will do nothing when such a CRLF is found", + "warn", "Git will issue a warning for each message if such a CRLF is found", + "strip", "Git will convert those CRLF to LF", + ), + }) +} diff --git a/completers/git_completer/cmd/mailinfo_generated.go b/completers/git_completer/cmd/mailinfo_generated.go deleted file mode 100644 index ea8f486c7e..0000000000 --- a/completers/git_completer/cmd/mailinfo_generated.go +++ /dev/null @@ -1,19 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var mailinfoCmd = &cobra.Command{ - Use: "mailinfo", - Short: "Extracts patch and authorship from a single e-mail message", - Run: func(cmd *cobra.Command, args []string) {}, - GroupID: groups[group_low_level_helper].ID, -} - -func init() { - carapace.Gen(mailinfoCmd).Standalone() - - rootCmd.AddCommand(mailinfoCmd) -}