Skip to content

Commit

Permalink
Use stderr for progress information
Browse files Browse the repository at this point in the history
Like this blog post describes, it's a unix convention: https://monkey.org/~marius/unix-tools-hints.html

Signed-off-by: Artem Sidorenko <[email protected]>
  • Loading branch information
artem-sidorenko committed Mar 20, 2019
1 parent 8f39ee8 commit 4a723a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/commands/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (

// Stdout references the Stdout writer for generate command
var Stdout io.Writer = os.Stdout // nolint: gochecknoglobals
// ProgressStdout references the Stdout writer for progress information
var ProgressStdout io.Writer = os.Stdout // nolint: gochecknoglobals
// ProgressWriter references the writer for progress information
var ProgressWriter io.Writer = os.Stderr // nolint: gochecknoglobals

// Generate implements the CLI subcommand generate
func Generate(ctx *cli.Context) error { // nolint: gocyclo
Expand Down Expand Up @@ -210,7 +210,7 @@ func getConnectorData(

// invoke the progress printer
printProgress(
ctx, ProgressStdout,
ctx, ProgressWriter,
ctagscounter, cmaxtags,
cissuescounter, cmaxissues,
cmrscounter, cmaxmrs)
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func TestGenerate(t *testing.T) { // nolint: gocyclo

// avoid progress output
progressOutput := &bytes.Buffer{}
generate.ProgressStdout = progressOutput
generate.ProgressWriter = progressOutput

testconnector.RetTestingTag = true
testconnector.RepositoryExistsFail = tt.repositoryExistsFail
Expand Down

0 comments on commit 4a723a3

Please sign in to comment.