Jelajahi Sumber

fix error message when detach is implied by wait

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 9 bulan lalu
induk
melakukan
b27f56eb19
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      cmd/compose/up.go

+ 5 - 1
cmd/compose/up.go

@@ -193,7 +193,11 @@ func validateFlags(up *upOptions, create *createOptions) error {
 		return fmt.Errorf("--build and --no-build are incompatible")
 	}
 	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 up.wait {
+			return fmt.Errorf("--wait cannot be combined with --abort-on-container-exit, --abort-on-container-failure, --attach, --attach-dependencies or --watch")
+		} else {
+			return fmt.Errorf("--detach cannot be combined with --abort-on-container-exit, --abort-on-container-failure, --attach, --attach-dependencies or --watch")
+		}
 	}
 	if create.noInherit && create.noRecreate {
 		return fmt.Errorf("--no-recreate and --renew-anon-volumes are incompatible")