when ran with ANSI disabled, force progress=plain

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2024-02-16 18:18:09 +01:00 committed by Nicolas De loof
parent 6c175548b8
commit 9630cc5808
1 changed files with 3 additions and 0 deletions

View File

@ -395,6 +395,9 @@ func RootCommand(dockerCli command.Cli, backend api.Service) *cobra.Command { //
switch opts.Progress {
case ui.ModeAuto:
ui.Mode = ui.ModeAuto
if ansi == "never" {
ui.Mode = ui.ModePlain
}
case ui.ModeTTY:
if ansi == "never" {
return fmt.Errorf("can't use --progress tty while ANSI support is disabled")