MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / executeCommand

Function executeCommand

cmd/helpers_for_test.go:139–148  ·  view source on GitHub ↗

A helper to ignore os.Exit(1) errors when running a cobra Command

(root *cobra.Command,
	args ...string)

Source from the content-addressed store, hash-verified

137
138// A helper to ignore os.Exit(1) errors when running a cobra Command
139func executeCommand(root *cobra.Command,
140 args ...string) (stdout string, err error) {
141 for i, arg := range args {
142 tInfo(fmt.Sprintf("(%d) %s", i, arg))
143 }
144 // programs can exit with error here..
145 stdout, _, err = executeCommandC(root, args...)
146 tInfo("The command successfully returned values for assertion.")
147 return stdout, err
148}
149
150// A helper to ignore os.Exit(1) errors when running a cobra Command
151func executeCommandC(root *cobra.Command, args ...string) (stdout string, output string, err error) {

Callers 3

TestLoginFunction · 0.85
executeCommandMethod · 0.85
TestGenDocFunction · 0.85

Calls 2

tInfoFunction · 0.85
executeCommandCFunction · 0.85

Tested by

no test coverage detected