Merge pull request #6958 from smarterclayton/args_remain_in_order

`kubectl get rc,pods` should invoke in that order
This commit is contained in:
Clayton Coleman 2015-04-17 11:30:09 -04:00
commit 4833578a57

View File

@ -600,8 +600,16 @@ func (b *Builder) Do() *Result {
return r
}
// SplitResourceArgument splits the argument with commas and returns unique
// strings in the original order.
func SplitResourceArgument(arg string) []string {
out := []string{}
set := util.NewStringSet()
set.Insert(strings.Split(arg, ",")...)
return set.List()
for _, s := range strings.Split(arg, ",") {
if set.Has(s) {
continue
}
out = append(out, s)
}
return out
}