Skip to content

Commit bd993c8

Browse files
cli: core list
1 parent a075e5e commit bd993c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/cli/core/list.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,32 +89,32 @@ func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.PlatformSu
8989
func newCoreListResult(in []*rpc.PlatformSummary, updatableOnly bool) *coreListResult {
9090
res := &coreListResult{updatableOnly: updatableOnly}
9191
for _, platformSummary := range in {
92-
res.platforms = append(res.platforms, result.NewPlatformSummary(platformSummary))
92+
res.Platforms = append(res.Platforms, result.NewPlatformSummary(platformSummary))
9393
}
9494
return res
9595
}
9696

9797
type coreListResult struct {
98-
platforms []*result.PlatformSummary
98+
Platforms []*result.PlatformSummary `json:"platforms"`
9999
updatableOnly bool
100100
}
101101

102102
// Data implements Result interface
103103
func (ir coreListResult) Data() interface{} {
104-
return ir.platforms
104+
return ir
105105
}
106106

107107
// String implements Result interface
108108
func (ir coreListResult) String() string {
109-
if len(ir.platforms) == 0 {
109+
if len(ir.Platforms) == 0 {
110110
if ir.updatableOnly {
111111
return tr("All platforms are up to date.")
112112
}
113113
return tr("No platforms installed.")
114114
}
115115
t := table.New()
116116
t.SetHeader(tr("ID"), tr("Installed"), tr("Latest"), tr("Name"))
117-
for _, platform := range ir.platforms {
117+
for _, platform := range ir.Platforms {
118118
latestVersion := platform.LatestVersion.String()
119119
if latestVersion == "" {
120120
latestVersion = "n/a"

0 commit comments

Comments
 (0)