Skip to content

Commit

Permalink
Merge pull request #656 from rsteube/add-winepath
Browse files Browse the repository at this point in the history
added winepath
  • Loading branch information
rsteube authored Oct 6, 2021
2 parents 9747914 + e6371ea commit 829709d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
30 changes: 30 additions & 0 deletions completers/winepath_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -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(),
)
}
7 changes: 7 additions & 0 deletions completers/winepath_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/winepath_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit 829709d

Please sign in to comment.