mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-10 06:56:38 +00:00
Add hint in usage about quoting flags in powershell (#95)
This commit is contained in:
committed by
Martin Lindhe
parent
88271ddf14
commit
7537c9896e
@@ -157,6 +157,13 @@ func initWbem() {
|
||||
wmi.DefaultClient.SWbemServicesClient = s
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
|
||||
flag.PrintDefaults()
|
||||
fmt.Fprintf(os.Stderr, "\nNote: If executing from Powershell, the flags need to quoted. For example:\n%s\n",
|
||||
"\twmi_exporter \"-collectors.enabled\" iis")
|
||||
}
|
||||
|
||||
func main() {
|
||||
var (
|
||||
showVersion = flag.Bool("version", false, "Print version information.")
|
||||
@@ -165,6 +172,7 @@ func main() {
|
||||
enabledCollectors = flag.String("collectors.enabled", filterAvailableCollectors(defaultCollectors), "Comma-separated list of collectors to use. Use '[default]' as a placeholder for all the collectors enabled by default")
|
||||
printCollectors = flag.Bool("collectors.print", false, "If true, print available collectors and exit.")
|
||||
)
|
||||
flag.Usage = usage
|
||||
flag.Parse()
|
||||
|
||||
if *showVersion {
|
||||
|
||||
Reference in New Issue
Block a user