-
-
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 #1125 from rsteube/add-go-carpet
added go-carpet
- Loading branch information
Showing
2 changed files
with
42 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,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 | ||
}) | ||
} |
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/go-carpet_completer/cmd" | ||
|
||
func main() { | ||
cmd.Execute() | ||
} |