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

Method UserAssets

internal/attachments/flags.go:63–71  ·  view source on GitHub ↗

UserAssets validates the files named by the attachment flag, keeping them in the order they were written. It returns nothing when the flag was not passed.

()

Source from the content-addressed store, hash-verified

61// UserAssets validates the files named by the attachment flag, keeping them in
62// the order they were written. It returns nothing when the flag was not passed.
63func (f *Flag) UserAssets() ([]UserAsset, error) {
64 if !f.Changed() {
65 return nil, nil
66 }
67 if len(f.values) > maxAttachments {
68 return nil, fmt.Errorf("`--attach` accepts at most %d values per command", maxAttachments)
69 }
70 return userAssetsFromArgs(f.values)
71}
72
73func userAssetsFromArgs(args []string) ([]UserAsset, error) {
74 // --attach "" is a user error.

Callers 8

NewCmdCreateFunction · 0.80
NewCmdEditFunction · 0.80
CommentablePreRunFunction · 0.80
NewCmdCreateFunction · 0.80
NewCmdEditFunction · 0.80
NewTestAssetsFunction · 0.80
assetsFromArgsFunction · 0.80
TestFlagUserAssetsFunction · 0.80

Calls 3

ChangedMethod · 0.95
userAssetsFromArgsFunction · 0.85
ErrorfMethod · 0.65

Tested by 2

assetsFromArgsFunction · 0.64
TestFlagUserAssetsFunction · 0.64