Don't suggest an item which user already mentioned. (#1702)
This commit is contained in:
parent
568eb1d4e0
commit
52447f6999
1 changed files with 1 additions and 5 deletions
|
@ -112,12 +112,8 @@ func compAllItems(itemType string, args []string, toComplete string) ([]string,
|
|||
comp := make([]string, 0)
|
||||
hubItems := cwhub.GetHubStatusForItemType(itemType, "", true)
|
||||
for _, item := range hubItems {
|
||||
if toComplete == "" {
|
||||
if !inSlice(item.Name, args) && strings.Contains(item.Name, toComplete) {
|
||||
comp = append(comp, item.Name)
|
||||
} else {
|
||||
if strings.Contains(item.Name, toComplete) {
|
||||
comp = append(comp, item.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
cobra.CompDebugln(fmt.Sprintf("%s: %+v", itemType, comp), true)
|
||||
|
|
Loading…
Reference in a new issue