Index: pkg/analyzer_cli/lib/src/options.dart |
diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart |
index a8fec7965abec4bf7ab191b19d0b34a273e2d964..fc778f471d57a7d149805238dd19f4bfc0b35f65 100644 |
--- a/pkg/analyzer_cli/lib/src/options.dart |
+++ b/pkg/analyzer_cli/lib/src/options.dart |
@@ -465,9 +465,20 @@ class CommandLineOptions { |
// Persistent worker. |
if (args.contains('--persistent_worker')) { |
- if (args.length != 2 || !args.contains('--build-mode')) { |
+ bool validArgs; |
+ if (!args.contains('--build-mode')) { |
+ validArgs = false; |
+ } else if (args.length == 2) { |
+ validArgs = true; |
+ } else if (args.length == 4 && args.contains('--dart-sdk')) { |
+ validArgs = true; |
+ } else { |
+ validArgs = false; |
+ } |
+ if (!validArgs) { |
printAndFail('The --persistent_worker flag should be used with and ' |
- 'only with the --build-mode flag.'); |
+ 'only with the --build-mode flag, and possibly the --dart-sdk ' |
+ 'option. Got: $args'); |
return null; // Only reachable in testing. |
} |
return new CommandLineOptions._fromArgs(results, definedVariables); |