Ver Fonte

Merge pull request #16511 from Mashimiao/fix-logic-client-search

client/search: small logic fix
Phil Estes há 10 anos atrás
pai
commit
a7e8f3616c
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      api/client/search.go

+ 1 - 1
api/client/search.go

@@ -63,7 +63,7 @@ func (cli *DockerCli) CmdSearch(args ...string) error {
 	w := tabwriter.NewWriter(cli.out, 10, 1, 3, ' ', 0)
 	w := tabwriter.NewWriter(cli.out, 10, 1, 3, ' ', 0)
 	fmt.Fprintf(w, "NAME\tDESCRIPTION\tSTARS\tOFFICIAL\tAUTOMATED\n")
 	fmt.Fprintf(w, "NAME\tDESCRIPTION\tSTARS\tOFFICIAL\tAUTOMATED\n")
 	for _, res := range results {
 	for _, res := range results {
-		if ((*automated || *trusted) && (!res.IsTrusted && !res.IsAutomated)) || (int(*stars) > res.StarCount) {
+		if (*automated && !res.IsAutomated) || (int(*stars) > res.StarCount) || (*trusted && !res.IsTrusted) {
 			continue
 			continue
 		}
 		}
 		desc := strings.Replace(res.Description, "\n", " ", -1)
 		desc := strings.Replace(res.Description, "\n", " ", -1)