Configure full Docker setup and confirm consequential actions

This commit is contained in:
2026-10-09 21:34:47 +01:00
parent f60599230c
commit f700d1beb2
31 changed files with 587 additions and 49 deletions
+19
View File
@@ -0,0 +1,19 @@
package cli
import (
"bufio"
"fmt"
"strings"
)
func (a App) confirmAction(question string, yes bool) error {
if yes {
return nil
}
fmt.Fprint(a.Err, question+" [y/N]: ")
line, _ := bufio.NewReader(a.In).ReadString('\n')
if answer := strings.ToLower(strings.TrimSpace(line)); answer != "y" && answer != "yes" {
return fmt.Errorf("action canceled; use --yes for explicit non-interactive confirmation")
}
return nil
}