MCPcopy
hub / github.com/cli/cli / printResults

Function printResults

pkg/cmd/project/field-list/field_list.go:103–118  ·  view source on GitHub ↗
(config listConfig, fields []queries.ProjectField, login string)

Source from the content-addressed store, hash-verified

101}
102
103func printResults(config listConfig, fields []queries.ProjectField, login string) error {
104 if len(fields) == 0 {
105 return cmdutil.NewNoResultsError(fmt.Sprintf("Project %d for owner %s has no fields", config.opts.number, login))
106 }
107
108 tp := tableprinter.New(config.io, tableprinter.WithHeader("Name", "Data type", "ID"))
109
110 for _, f := range fields {
111 tp.AddField(f.Name())
112 tp.AddField(f.Type())
113 tp.AddField(f.ID(), tableprinter.WithTruncate(nil))
114 tp.EndRow()
115 }
116
117 return tp.Render()
118}

Callers 1

runListFunction · 0.70

Calls 7

NewNoResultsErrorFunction · 0.92
NewFunction · 0.92
WithHeaderFunction · 0.92
NameMethod · 0.65
IDMethod · 0.65
RenderMethod · 0.65
TypeMethod · 0.45

Tested by

no test coverage detected