From ccf864326324197613394b836d38dfdd48061be8 Mon Sep 17 00:00:00 2001 From: Rene Cunningham Date: Tue, 23 Feb 2021 11:00:56 +1100 Subject: [PATCH] CLI-35: include tenant name, if it is set, when rendering command failures. --- internal/cli/root.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/cli/root.go b/internal/cli/root.go index a7d0f4a68..d1d550c76 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -4,6 +4,7 @@ import ( "context" "os" + "github.com/auth0/auth0-cli/internal/ansi" "github.com/auth0/auth0-cli/internal/display" "github.com/spf13/cobra" ) @@ -74,6 +75,11 @@ func Execute() { // rootCmd.AddCommand(triggersCmd(cli)) if err := rootCmd.ExecuteContext(context.TODO()); err != nil { + header := []string{"error\n"} + if cli.tenant != "" { + header = append([]string{ansi.Bold(cli.tenant)}, header...) + } + cli.renderer.Heading(header...) cli.renderer.Errorf(err.Error()) os.Exit(1) }