From 13e506dc0d7a0836bfc460dec856734623f45484 Mon Sep 17 00:00:00 2001 From: Nedyalko Andreev Date: Thu, 7 Mar 2019 12:05:42 +0200 Subject: [PATCH] Fix the newline before the banner --- cmd/cloud.go | 3 ++- cmd/root.go | 2 +- cmd/run.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/cloud.go b/cmd/cloud.go index 27f3c01c6fc..e0344778c71 100644 --- a/cmd/cloud.go +++ b/cmd/cloud.go @@ -55,7 +55,8 @@ This will execute the test on the Load Impact cloud service. Use "k6 login cloud k6 cloud script.js`[1:], Args: exactArgsWithMsg(1, "arg should either be \"-\", if reading script from stdin, or a path to a script file"), RunE: func(cmd *cobra.Command, args []string) error { - _, _ = BannerColor.Fprint(stdout, Banner+"\n\n") + //TODO: disable in quiet mode? + _, _ = BannerColor.Fprintf(stdout, "\n%s\n\n", Banner) initBar := ui.ProgressBar{ Width: 60, Left: func() string { return " uploading script" }, diff --git a/cmd/root.go b/cmd/root.go index e61545c8a52..92dc0b1c1cc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -72,7 +72,7 @@ var ( var RootCmd = &cobra.Command{ Use: "k6", Short: "a next-generation load generator", - Long: BannerColor.Sprint(Banner), + Long: BannerColor.Sprintf("\n%s", Banner), SilenceUsage: true, SilenceErrors: true, PersistentPreRun: func(cmd *cobra.Command, args []string) { diff --git a/cmd/run.go b/cmd/run.go index 6e1c1612906..5e108a4768e 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -100,7 +100,8 @@ a commandline interface for interacting with it.`, k6 run -o influxdb=http://1.2.3.4:8086/k6`[1:], Args: exactArgsWithMsg(1, "arg should either be \"-\", if reading script from stdin, or a path to a script file"), RunE: func(cmd *cobra.Command, args []string) error { - _, _ = BannerColor.Fprint(stdout, Banner+"\n\n") + //TODO: disable in quiet mode? + _, _ = BannerColor.Fprintf(stdout, "\n%s\n\n", Banner) initBar := ui.ProgressBar{ Width: 60,