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

Function AddFlag

internal/attachments/flags.go:29–35  ·  view source on GitHub ↗

AddFlag registers the repeatable --attach flag on cmd.

(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

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