From 79322ba986a7908e45a51d414d63c47a698658f5 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 24 Aug 2023 14:14:02 +0200 Subject: [PATCH] cli: change message when all platform are already up to date when providing --updatable --- internal/cli/core/list.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/cli/core/list.go b/internal/cli/core/list.go index 0116093c5b5..31c10214fe3 100644 --- a/internal/cli/core/list.go +++ b/internal/cli/core/list.go @@ -55,7 +55,10 @@ func runListCommand(args []string, all bool, updatableOnly bool) { // List gets and prints a list of installed platforms. func List(inst *rpc.Instance, all bool, updatableOnly bool) { platforms := GetList(inst, all, updatableOnly) - feedback.PrintResult(installedResult{platforms}) + feedback.PrintResult(installedResult{ + platforms: platforms, + updatableOnly: updatableOnly, + }) } // GetList returns a list of installed platforms. @@ -74,7 +77,8 @@ func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.Platform { // output from this command requires special formatting, let's create a dedicated // feedback.Result implementation type installedResult struct { - platforms []*rpc.Platform + platforms []*rpc.Platform + updatableOnly bool } func (ir installedResult) Data() interface{} { @@ -83,6 +87,9 @@ func (ir installedResult) Data() interface{} { func (ir installedResult) String() string { if len(ir.platforms) == 0 { + if ir.updatableOnly { + return tr("All platforms are up to date.") + } return tr("No platforms installed.") } t := table.New()