From 05ae1472e348a0e1912fe4f15a5a1c54bdc97c11 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 5 Jun 2020 10:37:36 +0300 Subject: [PATCH] app/vmagent: print brief usage info for `vmagent -help` --- app/vmagent/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/vmagent/main.go b/app/vmagent/main.go index 66bd501b5..68a06ddf5 100644 --- a/app/vmagent/main.go +++ b/app/vmagent/main.go @@ -54,6 +54,7 @@ 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() logger.Init() @@ -205,3 +206,15 @@ var ( promscrapeConfigReloadRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/-/reload"}`) ) + +func usage() { + const s = ` +vmagent collects metrics data via popular data ingestion protocols and routes it to VictoriaMetrics. + +See the docs at https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmagent/README.md . +` + + f := flag.CommandLine.Output() + fmt.Fprintf(f, "%s\n", s) + flag.PrintDefaults() +}