Skip to content

Commit

Permalink
Merge pull request #623 from tursodatabase/athos/autocomplete-remove-…
Browse files Browse the repository at this point in the history
…repeated-locations

Remove duplicated locations from autocomplete
  • Loading branch information
athoscouto authored Sep 11, 2023
2 parents 322d714 + 5d47878 commit 07858fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/cmd/group_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,9 @@ func locationsCmdsArgs(cmd *cobra.Command, args []string, toComplete string) ([]
return nil, cobra.ShellCompDirectiveNoFileComp | cobra.ShellCompDirectiveNoSpace
}
locations, _ := locations(client)
used := args[1:]
for _, location := range used {
delete(locations, location)
}
return maps.Keys(locations), cobra.ShellCompDirectiveNoFileComp | cobra.ShellCompDirectiveNoSpace
}

0 comments on commit 07858fc

Please sign in to comment.