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

Function listRun

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

Source from the content-addressed store, hash-verified

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