Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Unified Diff: pkg/analyzer/lib/src/command_line/arguments.dart

Issue 2581723002: cleanup Analyzer CLI and DDC arg parsing (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/command_line/arguments_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/command_line/arguments.dart
diff --git a/pkg/analyzer/lib/src/command_line/arguments.dart b/pkg/analyzer/lib/src/command_line/arguments.dart
index 6ad44aff58da60639e5960b8852e293c67c80017..5b43d3c2e489671794c6971205affe0e5f0ca587 100644
--- a/pkg/analyzer/lib/src/command_line/arguments.dart
+++ b/pkg/analyzer/lib/src/command_line/arguments.dart
@@ -184,7 +184,10 @@ List<String> extractDefinedVariables(
remainingArgs.add(args[i++]);
}
} else if (arg.startsWith("-D")) {
- if (i + 1 < count) {
+ int end = arg.indexOf('=');
+ if (end > 2) {
+ definedVariables[arg.substring(2, end)] = arg.substring(end + 1);
+ } else if (i + 1 < count) {
definedVariables[arg.substring(2)] = args[++i];
} else {
remainingArgs.add(arg);
« no previous file with comments | « no previous file | pkg/analyzer/test/src/command_line/arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698