Skip to content

Commit 05a9f90

Browse files
cli: core search
1 parent bd993c8 commit 05a9f90

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: internal/cli/core/search.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,27 @@ func runSearchCommand(cmd *cobra.Command, args []string, allVersions bool) {
8686
// output from this command requires special formatting, let's create a dedicated
8787
// feedback.Result implementation
8888
type searchResults struct {
89-
platforms []*result.PlatformSummary
89+
Platforms []*result.PlatformSummary `json:"platforms"`
9090
allVersions bool
9191
}
9292

9393
func newSearchResult(in []*rpc.PlatformSummary, allVersions bool) *searchResults {
9494
res := &searchResults{
95-
platforms: make([]*result.PlatformSummary, len(in)),
95+
Platforms: make([]*result.PlatformSummary, len(in)),
9696
allVersions: allVersions,
9797
}
9898
for i, platformSummary := range in {
99-
res.platforms[i] = result.NewPlatformSummary(platformSummary)
99+
res.Platforms[i] = result.NewPlatformSummary(platformSummary)
100100
}
101101
return res
102102
}
103103

104104
func (sr searchResults) Data() interface{} {
105-
return sr.platforms
105+
return sr
106106
}
107107

108108
func (sr searchResults) String() string {
109-
if len(sr.platforms) == 0 {
109+
if len(sr.Platforms) == 0 {
110110
return tr("No platforms matching your search.")
111111
}
112112

@@ -121,7 +121,7 @@ func (sr searchResults) String() string {
121121
t.AddRow(platform.Id, release.Version, release.FormatName())
122122
}
123123

124-
for _, platform := range sr.platforms {
124+
for _, platform := range sr.Platforms {
125125
// When allVersions is not requested we only show the latest compatible version
126126
if !sr.allVersions {
127127
addRow(platform, platform.GetLatestRelease())

0 commit comments

Comments
 (0)