From a24df75241892b2da0e07bfefb6eac7370918087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Barroso?= Date: Mon, 18 Oct 2021 14:13:11 +0200 Subject: [PATCH] feat: update wording on `remove` --- cmd/meroxa/root/environments/describe_test.go | 1 + cmd/meroxa/root/environments/remove.go | 5 +++-- cmd/meroxa/root/environments/remove_test.go | 6 ++++-- utils/display.go | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cmd/meroxa/root/environments/describe_test.go b/cmd/meroxa/root/environments/describe_test.go index d2e59f836..2a22c29c8 100644 --- a/cmd/meroxa/root/environments/describe_test.go +++ b/cmd/meroxa/root/environments/describe_test.go @@ -20,6 +20,7 @@ import ( "context" "encoding/json" "errors" + "github.com/golang/mock/gomock" "github.com/meroxa/cli/log" mock "github.com/meroxa/cli/mock-cmd" diff --git a/cmd/meroxa/root/environments/remove.go b/cmd/meroxa/root/environments/remove.go index 25215a791..844de6fb2 100644 --- a/cmd/meroxa/root/environments/remove.go +++ b/cmd/meroxa/root/environments/remove.go @@ -19,6 +19,7 @@ package environments import ( "context" "errors" + "github.com/meroxa/cli/cmd/meroxa/builder" "github.com/meroxa/cli/log" "github.com/meroxa/meroxa-go" @@ -64,7 +65,7 @@ func (r *Remove) Confirm(_ context.Context) (wantInput string) { } func (r *Remove) Execute(ctx context.Context) error { - r.logger.Infof(ctx, "Removing environment %q...", r.args.Name) + r.logger.Infof(ctx, "Environment %q is being removed...", r.args.Name) // TODO: Check if this could return also env err := r.client.DeleteEnvironment(ctx, r.args.Name) @@ -72,7 +73,7 @@ func (r *Remove) Execute(ctx context.Context) error { return err } - r.logger.Infof(ctx, "Environment %q successfully removed", r.args.Name) + r.logger.Infof(ctx, "\nRun `meroxa env describe %q` for status.", r.args.Name) e, err := r.client.GetEnvironment(ctx, r.args.Name) if err != nil { diff --git a/cmd/meroxa/root/environments/remove_test.go b/cmd/meroxa/root/environments/remove_test.go index 1a1565a32..b005c6161 100644 --- a/cmd/meroxa/root/environments/remove_test.go +++ b/cmd/meroxa/root/environments/remove_test.go @@ -20,14 +20,16 @@ import ( "context" "encoding/json" "errors" + "fmt" + "reflect" + "testing" + "github.com/golang/mock/gomock" "github.com/meroxa/cli/log" mock "github.com/meroxa/cli/mock-cmd" "github.com/meroxa/cli/utils" "github.com/meroxa/meroxa-go" - "reflect" - "testing" ) func TestRemoveEnvironmentArgs(t *testing.T) { diff --git a/utils/display.go b/utils/display.go index c5ed3bba6..f55713706 100644 --- a/utils/display.go +++ b/utils/display.go @@ -399,7 +399,7 @@ func EnvironmentsTable(environments []*meroxa.Environment, hideHeaders bool) str func EnvironmentTable(environment *meroxa.Environment) string { mainTable := simpletable.New() - envStatus := fmt.Sprintf("%s", environment.Status.State) + envStatus := environment.Status.State if environment.Status.Details != "" { envStatus += fmt.Sprintf("\n\nDetails: %s", environment.Status.Details) @@ -408,7 +408,7 @@ func EnvironmentTable(environment *meroxa.Environment) string { mainTable.Body.Cells = [][]*simpletable.Cell{ { {Align: simpletable.AlignRight, Text: "UUID:"}, - {Text: fmt.Sprintf("%s", environment.UUID)}, + {Text: environment.UUID}, }, { {Align: simpletable.AlignRight, Text: "Name:"},