From 0269c841ecf30ef7a1e96693d2a9bf5733d9f304 Mon Sep 17 00:00:00 2001 From: rsteube Date: Fri, 16 Aug 2024 00:34:08 +0200 Subject: [PATCH] git: name-rev --- completers/git_completer/cmd/nameRev.go | 27 +++++++++++++++++++ .../git_completer/cmd/name_rev_generated.go | 26 ------------------ 2 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 completers/git_completer/cmd/nameRev.go delete mode 100644 completers/git_completer/cmd/name_rev_generated.go diff --git a/completers/git_completer/cmd/nameRev.go b/completers/git_completer/cmd/nameRev.go new file mode 100644 index 0000000000..10b9b2defa --- /dev/null +++ b/completers/git_completer/cmd/nameRev.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/spf13/cobra" +) + +var nameRevCmd = &cobra.Command{ + Use: "name-rev", + Short: "Find symbolic names for given revs", + Run: func(cmd *cobra.Command, args []string) {}, + GroupID: groups[group_low_level_interrogator].ID, +} + +func init() { + carapace.Gen(nameRevCmd).Standalone() + + nameRevCmd.Flags().Bool("all", false, "list all commits reachable from all refs") + nameRevCmd.Flags().Bool("always", false, "show uniquely abbreviated commit object as fallback") + nameRevCmd.Flags().Bool("annotate-stdin", false, "transform stdin by substituting all the 40-character SHA-1 hexes") + nameRevCmd.Flags().String("exclude", "", "do not use any ref whose name matches a given shell pattern") + nameRevCmd.Flags().Bool("name-only", false, "print only the name") + nameRevCmd.Flags().Bool("no-undefined", false, "die with error code != 0 when a reference is undefined") + nameRevCmd.Flags().String("refs", "", "only use refs whose names match a given shell pattern") + nameRevCmd.Flags().Bool("tags", false, "only use tags to name the commits") + rootCmd.AddCommand(nameRevCmd) +} diff --git a/completers/git_completer/cmd/name_rev_generated.go b/completers/git_completer/cmd/name_rev_generated.go deleted file mode 100644 index 586bf8dd48..0000000000 --- a/completers/git_completer/cmd/name_rev_generated.go +++ /dev/null @@ -1,26 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var name_revCmd = &cobra.Command{ - Use: "name-rev", - Short: "Find symbolic names for given revs", - Run: func(cmd *cobra.Command, args []string) {}, - GroupID: groups[group_low_level_interrogator].ID, -} - -func init() { - carapace.Gen(name_revCmd).Standalone() - name_revCmd.Flags().Bool("all", false, "list all commits reachable from all refs") - name_revCmd.Flags().Bool("always", false, "show abbreviated commit object as fallback") - name_revCmd.Flags().String("exclude", "", "ignore refs matching ") - name_revCmd.Flags().Bool("name-only", false, "print only names (no SHA-1)") - name_revCmd.Flags().String("refs", "", "only use refs matching ") - name_revCmd.Flags().Bool("stdin", false, "read from stdin") - name_revCmd.Flags().Bool("tags", false, "only use tags to name the commits") - name_revCmd.Flags().Bool("undefined", false, "allow to print `undefined` names (default)") - rootCmd.AddCommand(name_revCmd) -}