Skip to content

Commit

Permalink
added go-carpet
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed May 11, 2022
1 parent db5b928 commit ab91338
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
35 changes: 35 additions & 0 deletions completers/go-carpet_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "go-carpet",
Short: "show test coverage for Go source files",
Long: "https://github.com/msoap/go-carpet",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().Bool("256colors", false, "use more colors on 256-color terminal")
rootCmd.Flags().String("args", "", "pass additional arguments for go test")
rootCmd.Flags().String("file", "", "comma-separated list of files to test")
rootCmd.Flags().String("func", "", "comma-separated functions list")
rootCmd.Flags().Bool("include-vendor", false, "include vendor directories for show coverage")
rootCmd.Flags().Bool("summary", false, "only show summary for each file")
rootCmd.Flags().Bool("version", false, "get version")

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"file": carapace.ActionMultiParts(",", func(c carapace.Context) carapace.Action {
return carapace.ActionFiles()
}),
// TODO complete funcs
})
}
7 changes: 7 additions & 0 deletions completers/go-carpet_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/go-carpet_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit ab91338

Please sign in to comment.