mirror of
https://github.com/docker/compose.git
synced 2025-07-22 21:24:38 +02:00
apply filter before formatter
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
6ecf8209ef
commit
8d476eee4c
@ -127,13 +127,6 @@ SERVICES:
|
|||||||
return api.ErrNotFound
|
return api.ErrNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.Quiet {
|
|
||||||
for _, s := range containers {
|
|
||||||
fmt.Println(s.ID)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if opts.Status != "" {
|
if opts.Status != "" {
|
||||||
containers = filterByStatus(containers, opts.Status)
|
containers = filterByStatus(containers, opts.Status)
|
||||||
}
|
}
|
||||||
@ -142,6 +135,13 @@ SERVICES:
|
|||||||
return containers[i].Name < containers[j].Name
|
return containers[i].Name < containers[j].Name
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if opts.Quiet {
|
||||||
|
for _, c := range containers {
|
||||||
|
fmt.Println(c.ID)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return formatter.Print(containers, opts.Format, os.Stdout,
|
return formatter.Print(containers, opts.Format, os.Stdout,
|
||||||
writter(containers),
|
writter(containers),
|
||||||
"NAME", "COMMAND", "SERVICE", "STATUS", "PORTS")
|
"NAME", "COMMAND", "SERVICE", "STATUS", "PORTS")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user