Switch to kingpin flags (#639)

* Switch to kingpin flags

* Fix logrus vendoring

* Fix flags in main tests

* Fix vendoring versions
This commit is contained in:
Calle Pettersson 2017-08-12 15:07:24 +02:00 committed by Ben Kochie
commit dfe07eaae8
84 changed files with 9904 additions and 196 deletions

View file

@ -14,13 +14,14 @@
package collector
import (
"flag"
"io/ioutil"
"sort"
"strings"
"testing"
"github.com/golang/protobuf/proto"
"github.com/prometheus/common/log"
"gopkg.in/alecthomas/kingpin.v2"
)
func TestParseTextFiles(t *testing.T) {
@ -49,7 +50,8 @@ func TestParseTextFiles(t *testing.T) {
// Suppress a log message about `nonexistent_path` not existing, this is
// expected and clutters the test output.
err := flag.Set("log.level", "fatal")
log.AddFlags(kingpin.CommandLine)
_, err := kingpin.CommandLine.Parse([]string{"--log.level", "fatal"})
if err != nil {
t.Fatal(err)
}