|
|
@@ -47,7 +47,6 @@ import (
|
|
|
ui "github.com/docker/compose/v2/pkg/progress"
|
|
|
"github.com/docker/compose/v2/pkg/remote"
|
|
|
"github.com/docker/compose/v2/pkg/utils"
|
|
|
- buildkit "github.com/moby/buildkit/util/progress/progressui"
|
|
|
"github.com/morikuni/aec"
|
|
|
"github.com/sirupsen/logrus"
|
|
|
"github.com/spf13/cobra"
|
|
|
@@ -230,7 +229,7 @@ func (o *ProjectOptions) addProjectFlags(f *pflag.FlagSet) {
|
|
|
f.StringVar(&o.ProjectDir, "project-directory", "", "Specify an alternate working directory\n(default: the path of the, first specified, Compose file)")
|
|
|
f.StringVar(&o.WorkDir, "workdir", "", "DEPRECATED! USE --project-directory INSTEAD.\nSpecify an alternate working directory\n(default: the path of the, first specified, Compose file)")
|
|
|
f.BoolVar(&o.Compatibility, "compatibility", false, "Run compose in backward compatibility mode")
|
|
|
- f.StringVar(&o.Progress, "progress", defaultStringVar(ComposeProgress, string(buildkit.AutoMode)), fmt.Sprintf(`Set type of progress output (%s)`, strings.Join(printerModes, ", ")))
|
|
|
+ f.StringVar(&o.Progress, "progress", os.Getenv(ComposeProgress), fmt.Sprintf(`Set type of progress output (%s)`, strings.Join(printerModes, ", ")))
|
|
|
f.BoolVar(&o.All, "all-resources", false, "Include all resources, even those not used by services")
|
|
|
_ = f.MarkHidden("workdir")
|
|
|
}
|
|
|
@@ -242,14 +241,6 @@ func defaultStringArrayVar(env string) []string {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// get default value for a command line flag from the env variable, if the env variable is not set, it returns the provided default value 'def'
|
|
|
-func defaultStringVar(env, def string) string {
|
|
|
- if v, ok := os.LookupEnv(env); ok {
|
|
|
- return v
|
|
|
- }
|
|
|
- return def
|
|
|
-}
|
|
|
-
|
|
|
func (o *ProjectOptions) projectOrName(ctx context.Context, dockerCli command.Cli, services ...string) (*types.Project, string, error) {
|
|
|
name := o.ProjectName
|
|
|
var project *types.Project
|
|
|
@@ -516,8 +507,7 @@ func RootCommand(dockerCli command.Cli, backend Backend) *cobra.Command { //noli
|
|
|
}
|
|
|
|
|
|
switch opts.Progress {
|
|
|
- case ui.ModeAuto:
|
|
|
- ui.Mode = ui.ModeAuto
|
|
|
+ case "", ui.ModeAuto:
|
|
|
if ansi == "never" {
|
|
|
ui.Mode = ui.ModePlain
|
|
|
}
|