Replace weave/common/mflagext with common/mflagext.

Removes duplication between weave and common and reduces the amount of sources to compile.
This commit is contained in:
Marc CARRE committed 2017-01-31 10:49:29 +00:00
1 parent 8f9b2a36c0
commit ee659d4033
2 files changed
+1 -32

No files matched your search

-31
View File
@@ -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))
}