From a5ba8c32531873d16aab017bef4e43995343abf3 Mon Sep 17 00:00:00 2001 From: Nedyalko Andreev Date: Sun, 6 Mar 2022 15:35:43 +0200 Subject: [PATCH] Do not output cloud login token to stdout when --quiet is enabled --- cmd/login_cloud.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/login_cloud.go b/cmd/login_cloud.go index f7b976763319..927ae8250ccd 100644 --- a/cmd/login_cloud.go +++ b/cmd/login_cloud.go @@ -148,7 +148,12 @@ This will set the default token used when just "k6 run -o cloud" is passed.`, if newCloudConf.Token.Valid { valueColor := getColor(globalState.flags.noColor || !globalState.stdOut.isTTY, color.FgCyan) - printToStdout(globalState, fmt.Sprintf(" token: %s\n", valueColor.Sprint(newCloudConf.Token.String))) + if !globalState.flags.quiet { + printToStdout(globalState, fmt.Sprintf(" token: %s\n", valueColor.Sprint(newCloudConf.Token.String))) + } + printToStdout(globalState, fmt.Sprintf( + "Logged in successfully, token saved in %s\n", globalState.flags.configFilePath, + )) } return nil },