From c18d5e71422c46907e45914a50d95c43492e1867 Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 6 Oct 2021 17:21:04 +0200 Subject: [PATCH] added wineserver --- completers/wineserver_completer/cmd/root.go | 40 +++++++++++++++++++++ completers/wineserver_completer/main.go | 7 ++++ 2 files changed, 47 insertions(+) create mode 100644 completers/wineserver_completer/cmd/root.go create mode 100644 completers/wineserver_completer/main.go diff --git a/completers/wineserver_completer/cmd/root.go b/completers/wineserver_completer/cmd/root.go new file mode 100644 index 0000000000..07acf7b845 --- /dev/null +++ b/completers/wineserver_completer/cmd/root.go @@ -0,0 +1,40 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/os" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "wineserver", + Short: "the Wine server", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().StringP("debug", "d", "", "set debug level to n or +1 if n not specified") + rootCmd.Flags().BoolP("foreground", "f", false, "remain in the foreground for debugging") + rootCmd.Flags().BoolP("help", "h", false, "display this help message") + rootCmd.Flags().StringP("kill", "k", "", "kill the current wineserver, optionally with signal n") + rootCmd.Flags().StringP("persistent", "p", "", "make server persistent, optionally for n seconds") + rootCmd.Flags().BoolP("version", "v", false, "display version information and exit") + rootCmd.Flags().BoolP("wait", "w", false, "wait until the current wineserver terminates") + + rootCmd.Flag("debug").NoOptDefVal = " " + rootCmd.Flag("kill").NoOptDefVal = " " + + carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{ + "debug": carapace.ActionValuesDescribed( + "0", "no debugging information", + "1", "normal", + "2", "extra verbose", + ), + "kill": os.ActionKillSignals(), + }) +} diff --git a/completers/wineserver_completer/main.go b/completers/wineserver_completer/main.go new file mode 100644 index 0000000000..35c3bb5fb4 --- /dev/null +++ b/completers/wineserver_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/wineserver_completer/cmd" + +func main() { + cmd.Execute() +}