(ctx context.Context, root *Command, args ...string)
| 57 | } |
| 58 | |
| 59 | func executeCommandWithContextC(ctx context.Context, root *Command, args ...string) (c *Command, output string, err error) { |
| 60 | buf := new(bytes.Buffer) |
| 61 | root.SetOut(buf) |
| 62 | root.SetErr(buf) |
| 63 | root.SetArgs(args) |
| 64 | |
| 65 | c, err = root.ExecuteContextC(ctx) |
| 66 | |
| 67 | return c, buf.String(), err |
| 68 | } |
| 69 | |
| 70 | func resetCommandLineFlagSet() { |
| 71 | pflag.CommandLine = pflag.NewFlagSet(os.Args[0], pflag.ExitOnError) |
no test coverage detected