mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-05 15:32:53 +00:00
added git-browse
This commit is contained in:
parent
2fa8731208
commit
5bce43f7dd
29
completers/git-browse_completer/cmd/root.go
Normal file
29
completers/git-browse_completer/cmd/root.go
Normal file
@ -0,0 +1,29 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git"
|
||||
"github.com/carapace-sh/carapace/pkg/traverse"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "git-browse",
|
||||
Short: "Opens the current git repository website in your default web browser",
|
||||
Long: "https://github.com/tj/git-extras/blob/master/Commands.md#git-browse",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func Execute() error {
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
func init() {
|
||||
carapace.Gen(rootCmd).Standalone()
|
||||
|
||||
rootCmd.Flags().Bool("help", false, "show help")
|
||||
|
||||
carapace.Gen(rootCmd).PositionalCompletion(
|
||||
git.ActionRemotes(),
|
||||
carapace.ActionFiles().ChdirF(traverse.GitWorkTree),
|
||||
)
|
||||
}
|
7
completers/git-browse_completer/main.go
Normal file
7
completers/git-browse_completer/main.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/git-browse_completer/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user