mirror of
https://github.com/rsteube/carapace-bin.git
synced 2025-05-05 15:32:53 +00:00
Added serie completer
This commit is contained in:
parent
82b6c2eb1c
commit
68c9aec654
35
completers/serie_completer/cmd/root.go
Normal file
35
completers/serie_completer/cmd/root.go
Normal file
@ -0,0 +1,35 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/carapace-sh/carapace"
|
||||
"github.com/carapace-sh/carapace/pkg/style"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "serie",
|
||||
Short: "A rich git commit graph in your terminal, like magic 📚",
|
||||
Long: "https://github.com/lusingander/serie",
|
||||
Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
func Execute() error {
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
|
||||
func init() {
|
||||
carapace.Gen(rootCmd).Standalone()
|
||||
|
||||
rootCmd.Flags().StringP("graph-width", "g", "", "Commit graph image cell width")
|
||||
rootCmd.Flags().BoolP("help", "h", false, "Print help")
|
||||
rootCmd.Flags().StringP("order", "o", "", "Commit ordering algorithm")
|
||||
rootCmd.Flags().Bool("preload", false, "Preload all graph images")
|
||||
rootCmd.Flags().StringP("protocol", "p", "", "Image protocol to render graph")
|
||||
rootCmd.Flags().BoolP("version", "V", false, "Print version")
|
||||
|
||||
carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
|
||||
"graph-width": carapace.ActionValues("double", "single"),
|
||||
"order": carapace.ActionValues("chrono", "topo"),
|
||||
"protocol": carapace.ActionValues("auto", "iterm", "kitty").StyleF(style.ForKeyword),
|
||||
})
|
||||
}
|
7
completers/serie_completer/main.go
Normal file
7
completers/serie_completer/main.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/carapace-sh/carapace-bin/completers/serie_completer/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user