MCPcopy
hub / github.com/kubernetes/test-infra / MakeCommand

Function MakeCommand

robots/coverage/cmd/diff/diff.go:36–51  ·  view source on GitHub ↗

MakeCommand returns a `diff` command.

()

Source from the content-addressed store, hash-verified

34
35// MakeCommand returns a `diff` command.
36func MakeCommand() *cobra.Command {
37 flags := &flags{}
38 cmd := &cobra.Command{
39 Use: "diff [base-profile] [new-profile]",
40 Short: "Calculate the file level difference between two coverage profiles",
41 Long: `Calculate the file level difference between two coverage profiles.
42 Produce the result in a markdown table`,
43 Run: func(cmd *cobra.Command, args []string) {
44 run(flags, cmd, args)
45 },
46 }
47 cmd.Flags().StringVarP(&flags.outputFile, "output", "o", "-", "output file")
48 cmd.Flags().StringVarP(&flags.jobName, "jobname", "j", "", "prow job name")
49 cmd.Flags().Float32VarP(&flags.threshold, "threshold", "t", .8, "code coverage threshold")
50 return cmd
51}
52
53func run(flags *flags, cmd *cobra.Command, args []string) {
54 if len(args) != 2 {

Callers 1

runFunction · 0.92

Calls 1

runFunction · 0.70

Tested by

no test coverage detected