From b8bf03156add638dfff8e0be8dee723bfb977879 Mon Sep 17 00:00:00 2001 From: rsteube Date: Mon, 2 Jan 2023 16:44:40 +0100 Subject: [PATCH] added git-info --- completers/git-info_completer/cmd/root.go | 24 +++++++++++++++++++++++ completers/git-info_completer/main.go | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 completers/git-info_completer/cmd/root.go create mode 100644 completers/git-info_completer/main.go diff --git a/completers/git-info_completer/cmd/root.go b/completers/git-info_completer/cmd/root.go new file mode 100644 index 0000000000..e11f81dcc2 --- /dev/null +++ b/completers/git-info_completer/cmd/root.go @@ -0,0 +1,24 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "git-info", + Short: "Returns information on current repository", + Long: "https://github.com/tj/git-extras/blob/master/Commands.md#git-info", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().BoolP("color", "c", false, "Use color for information titles") + rootCmd.Flags().Bool("help", false, "Display help message") + rootCmd.Flags().Bool("no-config", false, "Don't show list all variables set in config file, along with their values") +} diff --git a/completers/git-info_completer/main.go b/completers/git-info_completer/main.go new file mode 100644 index 0000000000..c96d0ce6a6 --- /dev/null +++ b/completers/git-info_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/git-info_completer/cmd" + +func main() { + cmd.Execute() +}