-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #656 from rsteube/add-winepath
added winepath
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |