Add hint in usage about quoting flags in powershell (#95)

This commit is contained in:
Calle Pettersson 2017-07-18 13:18:36 +02:00 committed by Martin Lindhe
parent 88271ddf14
commit 7537c9896e
1 changed files with 8 additions and 0 deletions

View File

@ -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 {