MCPcopy
hub / github.com/spf13/cobra / SetArgs

Method SetArgs

command.go:281–283  ·  view source on GitHub ↗

SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden particularly useful when testing.

(a []string)

Source from the content-addressed store, hash-verified

279// SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden
280// particularly useful when testing.
281func (c *Command) SetArgs(a []string) {
282 c.args = a
283}
284
285// SetOutput sets the destination for usage and error messages.
286// If output is nil, os.Stderr is used.

Callers 6

TestValidateFlagGroupsFunction · 0.95
testMethod · 0.95
executeCommandCFunction · 0.80

Calls

no outgoing calls

Tested by 6

TestValidateFlagGroupsFunction · 0.76
testMethod · 0.76
executeCommandCFunction · 0.64