@@ -18,17 +18,14 @@ package compose
1818
1919import (
2020 "context"
21-
2221 "github.com/docker/compose-cli/api/client"
2322 "github.com/docker/compose-cli/api/compose"
2423 "github.com/docker/compose-cli/api/progress"
25-
2624 "github.com/spf13/cobra"
2725)
2826
2927type startOptions struct {
3028 * projectOptions
31- Detach bool
3229}
3330
3431func startCommand (p * projectOptions ) * cobra.Command {
@@ -42,8 +39,6 @@ func startCommand(p *projectOptions) *cobra.Command {
4239 return runStart (cmd .Context (), opts , args )
4340 },
4441 }
45-
46- startCmd .Flags ().BoolVarP (& opts .Detach , "detach" , "d" , false , "Detached mode: Run containers in the background" )
4742 return startCmd
4843}
4944
@@ -58,32 +53,8 @@ func runStart(ctx context.Context, opts startOptions, services []string) error {
5853 return err
5954 }
6055
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 {})
8758 })
8859 return err
8960}
0 commit comments