Skip to content

Commit

Permalink
Merge pull request #658 from rsteube/add-wineserver
Browse files Browse the repository at this point in the history
added wineserver
  • Loading branch information
rsteube authored Oct 6, 2021
2 parents 013d774 + c18d5e7 commit ecfd941
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 ecfd941

Please sign in to comment.