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

Function matchLocalSkillByName

pkg/cmd/skills/install/install.go:827–834  ·  view source on GitHub ↗
(opts *InstallOptions, skills []discovery.Skill)

Source from the content-addressed store, hash-verified

825}
826
827func matchLocalSkillByName(opts *InstallOptions, skills []discovery.Skill) ([]discovery.Skill, error) {
828 for _, s := range skills {
829 if s.DisplayName() == opts.SkillName || s.Name == opts.SkillName {
830 return []discovery.Skill{s}, nil
831 }
832 }
833 return nil, fmt.Errorf("skill %q not found in local directory", opts.SkillName)
834}
835
836// skillSearchFunc returns a search function for MultiSelectWithSearch that
837// filters skills by case-insensitive substring match on name and description.

Callers

nothing calls this directly

Calls 2

DisplayNameMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected