Skip to content

Commit

Permalink
render quiet after filtering applied
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Nov 13, 2023
1 parent 43c3f54 commit 8de7aae
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cmd/compose/list.go
Expand Up @@ -72,12 +72,7 @@ func runList(ctx context.Context, dockerCli command.Cli, backend api.Service, ls
if err != nil {
return err
}
if lsOpts.Quiet {
for _, s := range stackList {
fmt.Fprintln(dockerCli.Out(), s.Name)
}
return nil
}


if filters.Len() > 0 {
var filtered []api.Stack
Expand All @@ -90,6 +85,13 @@ func runList(ctx context.Context, dockerCli command.Cli, backend api.Service, ls
stackList = filtered
}

if lsOpts.Quiet {
for _, s := range stackList {
fmt.Fprintln(dockerCli.Out(), s.Name)
}
return nil

Check warning on line 92 in cmd/compose/list.go

View check run for this annotation

Codecov / codecov/patch

cmd/compose/list.go#L89-L92

Added lines #L89 - L92 were not covered by tests
}

view := viewFromStackList(stackList)
return formatter.Print(view, lsOpts.Format, dockerCli.Out(), func(w io.Writer) {
for _, stack := range view {
Expand Down

0 comments on commit 8de7aae

Please sign in to comment.