@@ -18,17 +18,14 @@ package compose
18
18
19
19
import (
20
20
"context"
21
-
22
21
"github.com/docker/compose-cli/api/client"
23
22
"github.com/docker/compose-cli/api/compose"
24
23
"github.com/docker/compose-cli/api/progress"
25
-
26
24
"github.com/spf13/cobra"
27
25
)
28
26
29
27
type startOptions struct {
30
28
* projectOptions
31
- Detach bool
32
29
}
33
30
34
31
func startCommand (p * projectOptions ) * cobra.Command {
@@ -42,8 +39,6 @@ func startCommand(p *projectOptions) *cobra.Command {
42
39
return runStart (cmd .Context (), opts , args )
43
40
},
44
41
}
45
-
46
- startCmd .Flags ().BoolVarP (& opts .Detach , "detach" , "d" , false , "Detached mode: Run containers in the background" )
47
42
return startCmd
48
43
}
49
44
@@ -58,32 +53,8 @@ func runStart(ctx context.Context, opts startOptions, services []string) error {
58
53
return err
59
54
}
60
55
61
- if opts .Detach {
62
- _ , err = progress .Run (ctx , func (ctx context.Context ) (string , error ) {
63
- return "" , c .ComposeService ().Start (ctx , project , compose.StartOptions {})
64
- })
65
- return err
66
- }
67
-
68
- queue := make (chan compose.ContainerEvent )
69
- printer := printer {
70
- queue : queue ,
71
- }
72
- err = c .ComposeService ().Start (ctx , project , compose.StartOptions {
73
- Attach : func (event compose.ContainerEvent ) {
74
- queue <- event
75
- },
76
- })
77
- if err != nil {
78
- return err
79
- }
80
-
81
- _ , err = printer .run (ctx , false , "" , nil , func () error {
82
- ctx := context .Background ()
83
- _ , err := progress .Run (ctx , func (ctx context.Context ) (string , error ) {
84
- return "" , c .ComposeService ().Stop (ctx , project )
85
- })
86
- return err
56
+ _ , err = progress .Run (ctx , func (ctx context.Context ) (string , error ) {
57
+ return "" , c .ComposeService ().Start (ctx , project , compose.StartOptions {})
87
58
})
88
59
return err
89
60
}
0 commit comments