From dbae349ce61faeba347070e2252a3ded9a7a4da4 Mon Sep 17 00:00:00 2001 From: Nick Miyake Date: Mon, 6 Jul 2020 13:48:01 -0700 Subject: [PATCH] Fix documentation of "--quiet" flag to reflect behavior Clarify that "--quiet" flag disables logger output and removes previous code that purported to disable STDOUT output but did not actually do so. --- cmd/mockery.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/mockery.go b/cmd/mockery.go index d5040808..a9454cc3 100644 --- a/cmd/mockery.go +++ b/cmd/mockery.go @@ -8,7 +8,6 @@ import ( "regexp" "runtime/pprof" "strings" - "syscall" "time" homedir "github.com/mitchellh/go-homedir" @@ -80,7 +79,7 @@ func init() { pFlags.String("note", "", "comment to insert into prologue of each generated file") pFlags.String("cpuprofile", "", "write cpu profile to file") pFlags.Bool("version", false, "prints the installed version of mockery") - pFlags.Bool("quiet", false, "suppress output to stdout") + pFlags.Bool("quiet", false, `suppresses logger output (equivalent to --log-level="")`) pFlags.Bool("keeptree", false, "keep the tree structure of the original interface files into a different repository. Must be used with XX") pFlags.String("tags", "", "space-separated list of additional build tags to use") pFlags.String("filename", "", "name of generated file (only works with -name and no regex)") @@ -139,8 +138,7 @@ func (r *RootApp) Run() error { var limitOne bool if r.Quiet { - // if "quiet" flag is set, set os.Stdout to /dev/null to suppress all output to Stdout - os.Stdout = os.NewFile(uintptr(syscall.Stdout), os.DevNull) + // if "quiet" flag is set, disable logging r.Config.LogLevel = "" }