MCPcopy Create free account
hub / github.com/cli/cli / AddFlag

Function AddFlag

internal/attachments/flags.go:30–36  ·  view source on GitHub ↗

AddFlag registers the repeatable --attach flag on cmd.

(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

28
29// AddFlag registers the repeatable --attach flag on cmd.
30func AddFlag(cmd *cobra.Command) *Flag {
31 f := &Flag{}
32 // A string slice would split on commas, which are legal in filenames.
33 cmd.Flags().StringArrayVar(&f.values, flagName, nil, "Attach an image or video `file`, in '<file>#<image alt text>' format")
34 f.flag = cmd.Flags().Lookup(flagName)
35 return f
36}
37
38// Changed reports whether the attachment flag was passed.
39func (f *Flag) Changed() bool {

Callers 10

NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
commentableCmdFunction · 0.92
NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
NewTestAssetsFunction · 0.85
attachCmdFunction · 0.85
assetsFromArgsFunction · 0.85

Calls

no outgoing calls

Tested by 3

commentableCmdFunction · 0.74
attachCmdFunction · 0.68
assetsFromArgsFunction · 0.68