diff --git a/vendor/github.com/prometheus/common/model/time.go b/vendor/github.com/prometheus/common/model/time.go index 548968aeb..7e87f1ac6 100644 --- a/vendor/github.com/prometheus/common/model/time.go +++ b/vendor/github.com/prometheus/common/model/time.go @@ -163,9 +163,21 @@ func (t *Time) UnmarshalJSON(b []byte) error { // This type should not propagate beyond the scope of input/output processing. type Duration time.Duration +// Set implements pflag/flag.Value +func (d *Duration) Set(s string) error { + var err error + *d, err = ParseDuration(s) + return err +} + +// Type implements pflag.Value +func (d *Duration) Type() string { + return "duration" +} + var durationRE = regexp.MustCompile("^([0-9]+)(y|w|d|h|m|s|ms)$") -// StringToDuration parses a string into a time.Duration, assuming that a year +// ParseDuration parses a string into a time.Duration, assuming that a year // always has 365d, a week always has 7d, and a day always has 24h. func ParseDuration(durationStr string) (Duration, error) { matches := durationRE.FindStringSubmatch(durationStr) diff --git a/vendor/vendor.json b/vendor/vendor.json index 6130698c5..f513d31df 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -727,10 +727,10 @@ "revisionTime": "2017-06-16T09:39:39Z" }, { - "checksumSHA1": "0LL9u9tfv1KPBjNEiMDP6q7lpog=", + "checksumSHA1": "3VoqH7TFfzA6Ds0zFzIbKCUvBmw=", "path": "github.com/prometheus/common/model", - "revision": "9e0844febd9e2856f839c9cb974fbd676d1755a8", - "revisionTime": "2017-04-18T15:52:10Z" + "revision": "0d0c3d572886e0f2323ed376557f9eb99b97d25b", + "revisionTime": "2017-06-16T14:41:04Z" }, { "checksumSHA1": "9aDxDuzZt1l7FQJ9qpn2kPcF7NU=",