Преглед на файлове

return an error when --detach and --watch are used together in up command

Signed-off-by: Guillaume Lours <[email protected]>
Guillaume Lours преди 1 година
родител
ревизия
bf1bd3fc60
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      cmd/compose/up.go

+ 2 - 2
cmd/compose/up.go

@@ -186,8 +186,8 @@ func validateFlags(up *upOptions, create *createOptions) error {
 	if create.Build && create.noBuild {
 		return fmt.Errorf("--build and --no-build are incompatible")
 	}
-	if up.Detach && (up.attachDependencies || up.cascadeStop || up.cascadeFail || len(up.attach) > 0) {
-		return fmt.Errorf("--detach cannot be combined with --abort-on-container-exit, --abort-on-container-failure, --attach or --attach-dependencies")
+	if up.Detach && (up.attachDependencies || up.cascadeStop || up.cascadeFail || len(up.attach) > 0 || up.watch) {
+		return fmt.Errorf("--detach cannot be combined with --abort-on-container-exit, --abort-on-container-failure, --attach, --attach-dependencies or --watch")
 	}
 	if create.forceRecreate && create.noRecreate {
 		return fmt.Errorf("--force-recreate and --no-recreate are incompatible")