(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions)
| 33 | } |
| 34 | |
| 35 | func startCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command { |
| 36 | opts := startOptions{ |
| 37 | ProjectOptions: p, |
| 38 | } |
| 39 | startCmd := &cobra.Command{ |
| 40 | Use: "start [SERVICE...]", |
| 41 | Short: "Start services", |
| 42 | RunE: Adapt(func(ctx context.Context, args []string) error { |
| 43 | return runStart(ctx, dockerCli, backendOptions, opts, args) |
| 44 | }), |
| 45 | ValidArgsFunction: completeServiceNames(dockerCli, p), |
| 46 | } |
| 47 | flags := startCmd.Flags() |
| 48 | flags.BoolVar(&opts.wait, "wait", false, "Wait for services to be running|healthy. Implies detached mode.") |
| 49 | flags.IntVar(&opts.waitTimeout, "wait-timeout", 0, "Maximum duration in seconds to wait for the project to be running|healthy") |
| 50 | |
| 51 | return startCmd |
| 52 | } |
| 53 | |
| 54 | func runStart(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, opts startOptions, services []string) error { |
| 55 | project, name, err := opts.projectOrName(ctx, dockerCli, services...) |
no test coverage detected