Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 5cfa7f5

Browse files
authored
Merge pull request #1995 from ndeloof/ps_filter_q
apply filter before formatter
2 parents e54c974 + 8d476ee commit 5cfa7f5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cmd/compose/ps.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,6 @@ SERVICES:
127127
return api.ErrNotFound
128128
}
129129

130-
if opts.Quiet {
131-
for _, s := range containers {
132-
fmt.Println(s.ID)
133-
}
134-
return nil
135-
}
136-
137130
if opts.Status != "" {
138131
containers = filterByStatus(containers, opts.Status)
139132
}
@@ -142,6 +135,13 @@ SERVICES:
142135
return containers[i].Name < containers[j].Name
143136
})
144137

138+
if opts.Quiet {
139+
for _, c := range containers {
140+
fmt.Println(c.ID)
141+
}
142+
return nil
143+
}
144+
145145
return formatter.Print(containers, opts.Format, os.Stdout,
146146
writter(containers),
147147
"NAME", "COMMAND", "SERVICE", "STATUS", "PORTS")

0 commit comments

Comments
 (0)