Skip to content

Commit

Permalink
sort namespaces for getting smaller names first
Browse files Browse the repository at this point in the history
  • Loading branch information
kovetskiy committed Jun 19, 2019
1 parent c6efeff commit 67785a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/tubectl/complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"regexp"
"sort"
"strings"

"github.com/reconquest/karma-go"
Expand Down Expand Up @@ -54,6 +55,8 @@ func completeParams(client string, params *Params) (*Params, error) {
)
}

sort.Strings(namespaces)

completed := complete(namespaces, params.Namespace)
if completed == "" && params.Context != "" {
return params, fmt.Errorf(
Expand Down

0 comments on commit 67785a2

Please sign in to comment.