client/search: small logic fix

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
This commit is contained in:
Ma Shimiao 2015-09-23 14:03:58 +08:00
parent 22877e1b16
commit 19613feddf

View file

@ -63,7 +63,7 @@ func (cli *DockerCli) CmdSearch(args ...string) error {
w := tabwriter.NewWriter(cli.out, 10, 1, 3, ' ', 0)
fmt.Fprintf(w, "NAME\tDESCRIPTION\tSTARS\tOFFICIAL\tAUTOMATED\n")
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
}
desc := strings.Replace(res.Description, "\n", " ", -1)