Commit 4833578a authored by Clayton Coleman's avatar Clayton Coleman

Merge pull request #6958 from smarterclayton/args_remain_in_order

`kubectl get rc,pods` should invoke in that order
parents 3bc42f16 2c118356
...@@ -600,8 +600,16 @@ func (b *Builder) Do() *Result { ...@@ -600,8 +600,16 @@ func (b *Builder) Do() *Result {
return r return r
} }
// SplitResourceArgument splits the argument with commas and returns unique
// strings in the original order.
func SplitResourceArgument(arg string) []string { func SplitResourceArgument(arg string) []string {
out := []string{}
set := util.NewStringSet() set := util.NewStringSet()
set.Insert(strings.Split(arg, ",")...) for _, s := range strings.Split(arg, ",") {
return set.List() if set.Has(s) {
continue
}
out = append(out, s)
}
return out
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment