From 35b4d1de28947cb92264cc16a644b34c14badf4e Mon Sep 17 00:00:00 2001
From: Debdut Chakraborty <debdut.chakraborty@rocket.chat>
Date: Wed, 13 Oct 2021 08:59:16 +0530
Subject: [PATCH 1/2] Fix checking -t flag

Signed-off-by: Debdut Chakraborty <debdut.chakraborty@rocket.chat>
---
 cmd/compose/down.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cmd/compose/down.go b/cmd/compose/down.go
index 36878e96f..4be6ef0dc 100644
--- a/cmd/compose/down.go
+++ b/cmd/compose/down.go
@@ -43,10 +43,8 @@ func downCommand(p *projectOptions, backend api.Service) *cobra.Command {
 	downCmd := &cobra.Command{
 		Use:   "down",
 		Short: "Stop and remove containers, networks",
-		PreRun: func(cmd *cobra.Command, args []string) {
+		PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
 			opts.timeChanged = cmd.Flags().Changed("timeout")
-		},
-		PreRunE: Adapt(func(ctx context.Context, args []string) error {
 			if opts.images != "" {
 				if opts.images != "all" && opts.images != "local" {
 					return fmt.Errorf("invalid value for --rmi: %q", opts.images)

From 55a214a45eac42c41e866f6ffa6e9621dbc0720d Mon Sep 17 00:00:00 2001
From: Debdut Chakraborty <debdut.chakraborty@rocket.chat>
Date: Wed, 13 Oct 2021 09:11:44 +0530
Subject: [PATCH 2/2] Fix -t flag for compose up command

Signed-off-by: Debdut Chakraborty <debdut.chakraborty@rocket.chat>
---
 cmd/compose/up.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cmd/compose/up.go b/cmd/compose/up.go
index cfde2178a..a8d15ac7e 100644
--- a/cmd/compose/up.go
+++ b/cmd/compose/up.go
@@ -98,10 +98,8 @@ func upCommand(p *projectOptions, backend api.Service) *cobra.Command {
 	upCmd := &cobra.Command{
 		Use:   "up [SERVICE...]",
 		Short: "Create and start containers",
-		PreRun: func(cmd *cobra.Command, args []string) {
+		PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
 			create.timeChanged = cmd.Flags().Changed("timeout")
-		},
-		PreRunE: Adapt(func(ctx context.Context, args []string) error {
 			if up.exitCodeFrom != "" {
 				up.cascadeStop = true
 			}