lib/flagutil: specify additional description for all Array type flags (#620)

Array type flag is now defined as `value` type in flag description when printed.
This change adds additional description to every Array type flag so it would be
clear what exact type is used:
```
  -remoteWrite.urlRelabelConfig array
        Optional path to relabel config for the corresponding -remoteWrite.url
        Supports array of values separated by comma or specified via multiple flags.
```
This commit is contained in:
Roman Khavronenko 2020-07-13 19:56:37 +01:00 committed by GitHub
parent 19dd121968
commit 7e347972c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,8 @@ import (
// NewArray returns new Array with the given name and description.
func NewArray(name, description string) *Array {
var a Array
description += "\nSupports `array` of values separated by comma" +
" or specified via multiple flags."
flag.Var(&a, name, description)
return &a
}