Added serie completer

This commit is contained in:
Saurabh Kushwah 2025-04-20 17:16:31 +05:30
parent 82b6c2eb1c
commit 68c9aec654
No known key found for this signature in database
GPG Key ID: 8E11E1DCD6CCE8D5
2 changed files with 42 additions and 0 deletions

View 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),
})
}

View File

@ -0,0 +1,7 @@
package main
import "github.com/carapace-sh/carapace-bin/completers/serie_completer/cmd"
func main() {
cmd.Execute()
}