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

Function AppendActiveHelp

active_help.go:38–40  ·  view source on GitHub ↗

AppendActiveHelp adds the specified string to the specified array to be used as ActiveHelp. Such strings will be processed by the completion script and will be shown as ActiveHelp to the user. The array parameter should be the array that will contain the completions. This function can be called mult

(compArray []Completion, activeHelpStr string)

Source from the content-addressed store, hash-verified

36// the array. Each time this function is called with the same array, the new
37// ActiveHelp line will be shown below the previous ones when completion is triggered.
38func AppendActiveHelp(compArray []Completion, activeHelpStr string) []Completion {
39 return append(compArray, fmt.Sprintf("%s%s", activeHelpMarker, activeHelpStr))
40}
41
42// GetActiveHelpConfig returns the value of the ActiveHelp environment variable
43// <PROGRAM>_ACTIVE_HELP where <PROGRAM> is the name of the root command in upper

Callers 5

TestActiveHelpAloneFunction · 0.85
TestActiveHelpWithCompsFunction · 0.85
TestMultiActiveHelpFunction · 0.85
TestActiveHelpForFlagFunction · 0.85
TestDisableActiveHelpFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestActiveHelpAloneFunction · 0.68
TestActiveHelpWithCompsFunction · 0.68
TestMultiActiveHelpFunction · 0.68
TestActiveHelpForFlagFunction · 0.68
TestDisableActiveHelpFunction · 0.68