diff --git a/completers/winepath_completer/cmd/root.go b/completers/winepath_completer/cmd/root.go new file mode 100644 index 0000000000..03d1d9e00f --- /dev/null +++ b/completers/winepath_completer/cmd/root.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "winepath", + Short: "Tool to convert Unix paths to/from Win32 paths", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} +func init() { + carapace.Gen(rootCmd).Standalone() + + rootCmd.Flags().BoolS("0", "0", false, "separate output with \\0 character, instead of a newline") + rootCmd.Flags().BoolP("help", "h", false, "output this help message and exit") + rootCmd.Flags().BoolP("long", "l", false, "converts the short Windows path of an existing file or directory to the long format") + rootCmd.Flags().BoolP("short", "s", false, "converts the long Windows path of an existing file or directory to the short format") + rootCmd.Flags().BoolP("unix", "u", false, "converts a Windows path to a Unix path") + rootCmd.Flags().BoolP("windows", "w", false, "converts a Unix path to a long Windows path") + + carapace.Gen(rootCmd).PositionalAnyCompletion( + carapace.ActionFiles(), + ) +} diff --git a/completers/winepath_completer/main.go b/completers/winepath_completer/main.go new file mode 100644 index 0000000000..38befc11d7 --- /dev/null +++ b/completers/winepath_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/winepath_completer/cmd" + +func main() { + cmd.Execute() +}