From ee659d4033bbc8e4e2a51f17d6e808a72008a00c Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Tue, 31 Jan 2017 10:49:29 +0000 Subject: [PATCH] Replace weave/common/mflagext with common/mflagext. Removes duplication between weave and common and reduces the amount of sources to compile. --- common/mflagext/listvar.go | 31 ------------------------------- prog/weaveproxy/main.go | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 common/mflagext/listvar.go diff --git a/common/mflagext/listvar.go b/common/mflagext/listvar.go deleted file mode 100644 index c385e2cd..00000000 --- a/common/mflagext/listvar.go +++ /dev/null @@ -1,31 +0,0 @@ -package mflagext - -import ( - "fmt" - - "github.com/weaveworks/common/mflag" -) - -type listOpts struct { - value *[]string - hasBeenSet bool -} - -func ListVar(p *[]string, names []string, value []string, usage string) { - *p = value - mflag.Var(&listOpts{p, false}, names, usage) -} - -func (opts *listOpts) Set(value string) error { - if opts.hasBeenSet { - (*opts.value) = append((*opts.value), value) - } else { - (*opts.value) = []string{value} - opts.hasBeenSet = true - } - return nil -} - -func (opts *listOpts) String() string { - return fmt.Sprintf("%v", []string(*opts.value)) -} diff --git a/prog/weaveproxy/main.go b/prog/weaveproxy/main.go index 3f6b0644..bf326187 100644 --- a/prog/weaveproxy/main.go +++ b/prog/weaveproxy/main.go @@ -6,9 +6,9 @@ import ( "strings" "github.com/weaveworks/common/mflag" + "github.com/weaveworks/common/mflagext" "github.com/weaveworks/common/signals" "github.com/weaveworks/weave/common" - "github.com/weaveworks/weave/common/mflagext" "github.com/weaveworks/weave/proxy" )