diff --git a/app/victoria-metrics/main.go b/app/victoria-metrics/main.go index df50376f7..f15b5a49a 100644 --- a/app/victoria-metrics/main.go +++ b/app/victoria-metrics/main.go @@ -3,6 +3,7 @@ package main import ( "flag" "net/http" + "os" "time" "github.com/VictoriaMetrics/VictoriaMetrics/app/vminsert" @@ -25,6 +26,8 @@ var ( ) func main() { + // Write flags and help message to stdout, since it is easier to grep or pipe. + flag.CommandLine.SetOutput(os.Stdout) envflag.Parse() buildinfo.Init() logger.Init() diff --git a/app/vmagent/main.go b/app/vmagent/main.go index adb55223e..1c27f813a 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "net/http" + "os" "strings" "time" @@ -49,6 +50,8 @@ var ( ) func main() { + // Write flags and help message to stdout, since it is easier to grep or pipe. + flag.CommandLine.SetOutput(os.Stdout) envflag.Parse() buildinfo.Init() logger.Init() diff --git a/app/vmalert/main.go b/app/vmalert/main.go index b394eb621..c64f73b36 100644 --- a/app/vmalert/main.go +++ b/app/vmalert/main.go @@ -58,6 +58,8 @@ absolute path to all .yaml files in root.`) ) func main() { + // Write flags and help message to stdout, since it is easier to grep or pipe. + flag.CommandLine.SetOutput(os.Stdout) envflag.Parse() buildinfo.Init() logger.Init() diff --git a/app/vmauth/main.go b/app/vmauth/main.go index 4cc9f098b..335a527e2 100644 --- a/app/vmauth/main.go +++ b/app/vmauth/main.go @@ -5,6 +5,7 @@ import ( "net/http" "net/http/httputil" "net/url" + "os" "time" "github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo" @@ -19,6 +20,8 @@ var ( ) func main() { + // Write flags and help message to stdout, since it is easier to grep or pipe. + flag.CommandLine.SetOutput(os.Stdout) envflag.Parse() buildinfo.Init() logger.Init() diff --git a/app/vmbackup/main.go b/app/vmbackup/main.go index ed24bc38c..1e2dcbf18 100644 --- a/app/vmbackup/main.go +++ b/app/vmbackup/main.go @@ -31,6 +31,8 @@ var ( ) func main() { + // Write flags and help message to stdout, since it is easier to grep or pipe. + flag.CommandLine.SetOutput(os.Stdout) flag.Usage = usage envflag.Parse() buildinfo.Init() diff --git a/app/vmrestore/main.go b/app/vmrestore/main.go index c91fdefa1..6319008f3 100644 --- a/app/vmrestore/main.go +++ b/app/vmrestore/main.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "os" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/actions" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common" @@ -24,6 +25,8 @@ var ( ) func main() { + // Write flags and help message to stdout, since it is easier to grep or pipe. + flag.CommandLine.SetOutput(os.Stdout) flag.Usage = usage envflag.Parse() buildinfo.Init()