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:
1 parent
8f9b2a36c0
commit
ee659d4033
2 files changed
+1
-32
No files matched your search
@@ -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))
|
|
||||||
}
|
|
||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/weaveworks/common/mflag"
|
"github.com/weaveworks/common/mflag"
|
||||||
|
"github.com/weaveworks/common/mflagext"
|
||||||
"github.com/weaveworks/common/signals"
|
"github.com/weaveworks/common/signals"
|
||||||
"github.com/weaveworks/weave/common"
|
"github.com/weaveworks/weave/common"
|
||||||
"github.com/weaveworks/weave/common/mflagext"
|
|
||||||
"github.com/weaveworks/weave/proxy"
|
"github.com/weaveworks/weave/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user