From 8a29a04567b7d7d06378aa29c767dc1870ffb9c3 Mon Sep 17 00:00:00 2001 From: rsteube Date: Thu, 15 Dec 2022 21:45:39 +0100 Subject: [PATCH] added gitui --- completers/gitui_completer/cmd/root.go | 35 ++++++++++++++++++++++++++ completers/gitui_completer/main.go | 7 ++++++ 2 files changed, 42 insertions(+) create mode 100644 completers/gitui_completer/cmd/root.go create mode 100644 completers/gitui_completer/main.go diff --git a/completers/gitui_completer/cmd/root.go b/completers/gitui_completer/cmd/root.go new file mode 100644 index 0000000000..5ed9cf6583 --- /dev/null +++ b/completers/gitui_completer/cmd/root.go @@ -0,0 +1,35 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "gitui", + Short: "blazing fast terminal-ui for git", + Long: "https://github.com/extrawurst/gitui", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().String("bugreport", "", "Generate a bug report") + rootCmd.Flags().StringP("directory", "d", "", "Set the git directory") + rootCmd.Flags().BoolP("help", "h", false, "Print help information") + rootCmd.Flags().BoolP("logging", "l", false, "Stores logging output into a cache directory") + rootCmd.Flags().Bool("polling", false, "Poll folder for changes instead of using file system events") + rootCmd.Flags().StringP("theme", "t", "", "Set the color theme") + rootCmd.Flags().BoolP("version", "V", false, "Print version information") + rootCmd.Flags().StringP("workdir", "w", "", "Set the working directory") + + // TODO theme completion + carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{ + "directory": carapace.ActionDirectories(), + "workdir": carapace.ActionDirectories(), + }) +} diff --git a/completers/gitui_completer/main.go b/completers/gitui_completer/main.go new file mode 100644 index 0000000000..bc67229774 --- /dev/null +++ b/completers/gitui_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/gitui_completer/cmd" + +func main() { + cmd.Execute() +}