Skip to content

Commit 79322ba

Browse files
cli: change message when all platform are already up to date when providing --updatable
1 parent 37aae6b commit 79322ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

internal/cli/core/list.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ func runListCommand(args []string, all bool, updatableOnly bool) {
5555
// List gets and prints a list of installed platforms.
5656
func List(inst *rpc.Instance, all bool, updatableOnly bool) {
5757
platforms := GetList(inst, all, updatableOnly)
58-
feedback.PrintResult(installedResult{platforms})
58+
feedback.PrintResult(installedResult{
59+
platforms: platforms,
60+
updatableOnly: updatableOnly,
61+
})
5962
}
6063

6164
// GetList returns a list of installed platforms.
@@ -74,7 +77,8 @@ func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.Platform {
7477
// output from this command requires special formatting, let's create a dedicated
7578
// feedback.Result implementation
7679
type installedResult struct {
77-
platforms []*rpc.Platform
80+
platforms []*rpc.Platform
81+
updatableOnly bool
7882
}
7983

8084
func (ir installedResult) Data() interface{} {
@@ -83,6 +87,9 @@ func (ir installedResult) Data() interface{} {
8387

8488
func (ir installedResult) String() string {
8589
if len(ir.platforms) == 0 {
90+
if ir.updatableOnly {
91+
return tr("All platforms are up to date.")
92+
}
8693
return tr("No platforms installed.")
8794
}
8895
t := table.New()

0 commit comments

Comments
 (0)