Skip to content

Commit

Permalink
added wineserver
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 6, 2021
1 parent 829709d commit c18d5e7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
40 changes: 40 additions & 0 deletions completers/wineserver_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -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(),
})
}
7 changes: 7 additions & 0 deletions completers/wineserver_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/wineserver_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit c18d5e7

Please sign in to comment.