mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
app/vmauth: print brief usage info for vmauth -help
This commit is contained in:
parent
05ae1472e3
commit
ff1a725a56
1 changed files with 14 additions and 0 deletions
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httputil"
|
"net/http/httputil"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -22,6 +23,7 @@ var (
|
||||||
func main() {
|
func main() {
|
||||||
// Write flags and help message to stdout, since it is easier to grep or pipe.
|
// Write flags and help message to stdout, since it is easier to grep or pipe.
|
||||||
flag.CommandLine.SetOutput(os.Stdout)
|
flag.CommandLine.SetOutput(os.Stdout)
|
||||||
|
flag.Usage = usage
|
||||||
envflag.Parse()
|
envflag.Parse()
|
||||||
buildinfo.Init()
|
buildinfo.Init()
|
||||||
logger.Init()
|
logger.Init()
|
||||||
|
@ -80,3 +82,15 @@ var reverseProxy = &httputil.ReverseProxy{
|
||||||
FlushInterval: time.Second,
|
FlushInterval: time.Second,
|
||||||
ErrorLog: logger.StdErrorLogger(),
|
ErrorLog: logger.StdErrorLogger(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func usage() {
|
||||||
|
const s = `
|
||||||
|
vmauth authenticates and authorizes incoming requests and proxies them to VictoriaMetrics.
|
||||||
|
|
||||||
|
See the docs at https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmauth/README.md .
|
||||||
|
`
|
||||||
|
|
||||||
|
f := flag.CommandLine.Output()
|
||||||
|
fmt.Fprintf(f, "%s\n", s)
|
||||||
|
flag.PrintDefaults()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue