From ff4fa025f7b27570fd4041fa306da852f7321784 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sun, 29 Oct 2023 09:51:46 +0100 Subject: [PATCH] git: check-ref-format --- .../git_completer/cmd/checkRefFormat.go | 24 +++++++++++++++++++ .../cmd/check_ref_format_generated.go | 19 --------------- 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 completers/git_completer/cmd/checkRefFormat.go delete mode 100644 completers/git_completer/cmd/check_ref_format_generated.go diff --git a/completers/git_completer/cmd/checkRefFormat.go b/completers/git_completer/cmd/checkRefFormat.go new file mode 100644 index 0000000000..7ae6e5a2f3 --- /dev/null +++ b/completers/git_completer/cmd/checkRefFormat.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var checkRefFormatCmd = &cobra.Command{ + Use: "check-ref-format", + Short: "Ensures that a reference name is well formed", + Run: func(cmd *cobra.Command, args []string) {}, + GroupID: groups[group_low_level_helper].ID, +} + +func init() { + carapace.Gen(checkRefFormatCmd).Standalone() + + checkRefFormatCmd.Flags().Bool("allow-onelevel", false, "Controls whether one-level refnames are accepted") + checkRefFormatCmd.Flags().Bool("branch", false, "Check for valid branch name") + checkRefFormatCmd.Flags().Bool("no-allow-onelevel", false, "Controls whether one-level refnames are accepted") + checkRefFormatCmd.Flags().Bool("normalize", false, "Normalize refname by removing any leading slash characters") + checkRefFormatCmd.Flags().Bool("refspec-pattern", false, "Interpret as a reference name pattern for a refspec") + rootCmd.AddCommand(checkRefFormatCmd) +} diff --git a/completers/git_completer/cmd/check_ref_format_generated.go b/completers/git_completer/cmd/check_ref_format_generated.go deleted file mode 100644 index e6b8e7a997..0000000000 --- a/completers/git_completer/cmd/check_ref_format_generated.go +++ /dev/null @@ -1,19 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/spf13/cobra" -) - -var check_ref_formatCmd = &cobra.Command{ - Use: "check-ref-format", - Short: "Ensures that a reference name is well formed", - Run: func(cmd *cobra.Command, args []string) {}, - GroupID: groups[group_low_level_helper].ID, -} - -func init() { - carapace.Gen(check_ref_formatCmd).Standalone() - - rootCmd.AddCommand(check_ref_formatCmd) -}