MCPcopy Index your code
hub / github.com/larksuite/cli / SetTips

Function SetTips

internal/cmdutil/tips.go:15–24  ·  view source on GitHub ↗

SetTips sets the tips for a command (stored as JSON in Annotations).

(cmd *cobra.Command, tips []string)

Source from the content-addressed store, hash-verified

13
14// SetTips sets the tips for a command (stored as JSON in Annotations).
15func SetTips(cmd *cobra.Command, tips []string) {
16 if len(tips) == 0 {
17 return
18 }
19 if cmd.Annotations == nil {
20 cmd.Annotations = map[string]string{}
21 }
22 data, _ := json.Marshal(tips)
23 cmd.Annotations[tipsAnnotationKey] = string(data)
24}
25
26// AddTips appends tips to a command (merges with existing).
27func AddTips(cmd *cobra.Command, tips ...string) {

Callers 10

buildMethodCommandFunction · 0.92
NewCmdProfileRemoveFunction · 0.92
NewCmdProfileFunction · 0.92
NewCmdProfileUseFunction · 0.92
mountDeclarativeMethod · 0.92
TestSetTipsAndGetTipsFunction · 0.85
TestSetTipsEmptyFunction · 0.85
TestAddTipsFunction · 0.85
AddTipsFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestSetTipsAndGetTipsFunction · 0.68
TestSetTipsEmptyFunction · 0.68
TestAddTipsFunction · 0.68