MCPcopy
hub / github.com/cli/cli / listRun

Function listRun

pkg/cmd/skills/list/list.go:168–185  ·  view source on GitHub ↗
(opts *ListOptions)

Source from the content-addressed store, hash-verified

166}
167
168func listRun(opts *ListOptions) error {
169 skills, err := listInstalledSkills(opts)
170 if err != nil {
171 return err
172 }
173 sortListedSkills(skills)
174 recordListTelemetry(opts, len(skills))
175
176 if opts.Exporter != nil {
177 return opts.Exporter.Write(opts.IO, skills)
178 }
179
180 if len(skills) == 0 {
181 return cmdutil.NewNoResultsError("no installed skills found")
182 }
183
184 return renderTable(opts.IO, skills)
185}
186
187func listInstalledSkills(opts *ListOptions) ([]listedSkill, error) {
188 targets, err := buildScanTargets(opts)

Callers 2

TestListRunFunction · 0.70
NewCmdListFunction · 0.70

Calls 6

NewNoResultsErrorFunction · 0.92
listInstalledSkillsFunction · 0.85
sortListedSkillsFunction · 0.85
recordListTelemetryFunction · 0.85
renderTableFunction · 0.70
WriteMethod · 0.65

Tested by 1

TestListRunFunction · 0.56