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

Function MakeCommand

gopherage/cmd/diff/diff.go:33–50  ·  view source on GitHub ↗

MakeCommand returns a `diff` command.

()

Source from the content-addressed store, hash-verified

31
32// MakeCommand returns a `diff` command.
33func MakeCommand() *cobra.Command {
34 flags := &flags{}
35 cmd := &cobra.Command{
36 Use: "diff [first] [second]",
37 Short: "Diffs two Go coverage files.",
38 Long: `Takes the difference between two Go coverage files, producing another Go coverage file
39showing only what was covered between the two files being generated. This works best when using
40files generated in "count" or "atomic" mode; "set" may drastically underreport.
41
42It is assumed that both files came from the same execution, and so all values in the second file are
43at least equal to those in the first file.`,
44 Run: func(cmd *cobra.Command, args []string) {
45 run(flags, cmd, args)
46 },
47 }
48 cmd.Flags().StringVarP(&flags.OutputFile, "output", "o", "-", "output file")
49 return cmd
50}
51
52func run(flags *flags, cmd *cobra.Command, args []string) {
53 if len(args) != 2 {

Callers 1

runFunction · 0.92

Calls 1

runFunction · 0.70

Tested by

no test coverage detected