Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 2acce28

Browse files
committed
introduce --parallel and --no-parallel (hidden, deprecated) flags for backward compatibility
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 3366131 commit 2acce28

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

cli/cmd/compose/compose.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package compose
1818

1919
import (
2020
"fmt"
21+
"os"
2122

2223
"github.com/compose-spec/compose-go/cli"
2324
"github.com/compose-spec/compose-go/types"
@@ -113,7 +114,7 @@ func Command(contextType string) *cobra.Command {
113114
return errors.New(aec.Apply(`cannot specify DEPRECATED "--workdir" and "--project-directory". Please use only "--project-directory" instead.`, aec.RedF))
114115
}
115116
opts.ProjectDir = opts.WorkDir
116-
fmt.Println(aec.Apply(`option "--workdir" is DEPRECATED at root level! Please use "--project-directory" instead.`, aec.RedF))
117+
fmt.Fprint(os.Stderr, aec.Apply(`option "--workdir" is DEPRECATED at root level! Please use "--project-directory" instead.\n`, aec.RedF))
117118
}
118119
if contextType == store.DefaultContextType || contextType == store.LocalContextType {
119120
Warning = "The new 'docker compose' command is currently experimental. " +

cli/cmd/compose/pull.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ package compose
1818

1919
import (
2020
"context"
21+
"fmt"
22+
"os"
2123

24+
"github.com/morikuni/aec"
2225
"github.com/spf13/cobra"
2326

2427
"github.com/docker/compose-cli/api/client"
@@ -29,6 +32,8 @@ type pullOptions struct {
2932
*projectOptions
3033
composeOptions
3134
quiet bool
35+
parallel bool
36+
noParallel bool
3237
includeDeps bool
3338
}
3439

@@ -40,11 +45,19 @@ func pullCommand(p *projectOptions) *cobra.Command {
4045
Use: "pull [SERVICE...]",
4146
Short: "Pull service images",
4247
RunE: func(cmd *cobra.Command, args []string) error {
48+
if opts.noParallel {
49+
fmt.Fprint(os.Stderr, aec.Apply(`option "--no-parallel" is DEPRECATED and will be ignored.\n`, aec.RedF))
50+
}
4351
return runPull(cmd.Context(), opts, args)
4452
},
4553
}
46-
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Pull without printing progress information")
54+
flags := cmd.Flags()
55+
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Pull without printing progress information")
4756
cmd.Flags().BoolVar(&opts.includeDeps, "include-deps", false, "Also pull services declared as dependencies")
57+
cmd.Flags().BoolVar(&opts.parallel, "parallel", true, "DEPRECATED pull multiple images in parallel.")
58+
flags.MarkHidden("parallel") //nolint:errcheck
59+
cmd.Flags().BoolVar(&opts.parallel, "no-parallel", true, "DEPRECATED disable parallel pulling.")
60+
flags.MarkHidden("no-parallel") //nolint:errcheck
4861
return cmd
4962
}
5063

0 commit comments

Comments
 (0)