MCPcopy
hub / github.com/cli/cli / needsComments

Function needsComments

pkg/cmd/discussion/view/view.go:228–230  ·  view source on GitHub ↗

needsComments returns true when the command should fetch full comment data, either because --comments was set or because --json requested the comments field.

(opts *ViewOptions)

Source from the content-addressed store, hash-verified

226// needsComments returns true when the command should fetch full comment data,
227// either because --comments was set or because --json requested the comments field.
228func needsComments(opts *ViewOptions) bool {
229 return opts.Comments || (opts.Exporter != nil && slices.Contains(opts.Exporter.Fields(), "comments"))
230}
231
232func viewRun(opts *ViewOptions) error {
233 repo, err := opts.BaseRepo()

Callers 2

NewCmdViewFunction · 0.85
viewRunFunction · 0.85

Calls 2

ContainsMethod · 0.80
FieldsMethod · 0.65

Tested by

no test coverage detected