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

Unified Diff: compiler/java/com/google/dart/compiler/CommandLineOptions.java

Issue 11411136: Issue 6790. Support for '--name=value' options style. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/pkg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/CommandLineOptions.java
diff --git a/compiler/java/com/google/dart/compiler/CommandLineOptions.java b/compiler/java/com/google/dart/compiler/CommandLineOptions.java
index 93220fbd3e53264230779071e87b2a9153cb85fb..e2648013662c6037563aa96579ab6d53b4e5abd9 100644
--- a/compiler/java/com/google/dart/compiler/CommandLineOptions.java
+++ b/compiler/java/com/google/dart/compiler/CommandLineOptions.java
@@ -6,6 +6,7 @@ package com.google.dart.compiler;
import com.google.common.collect.Lists;
import com.google.dart.compiler.CompilerConfiguration.ErrorFormat;
+import com.google.dart.compiler.util.apache.StringUtils;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.CmdLineException;
@@ -14,6 +15,7 @@ import org.kohsuke.args4j.Option;
import java.io.File;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -269,6 +271,16 @@ public class CommandLineOptions {
*/
public static CmdLineParser parse(String[] args, CompilerOptions parsedOptions)
throws CmdLineException {
+ // convert new "--name=value" into old "--name value" style
+ {
+ List<String> argList = Lists.newArrayList();
+ for (String arg : args) {
+ String[] parts = StringUtils.split(arg, '=');
+ Collections.addAll(argList, parts);
+ }
+ args = argList.toArray(new String[argList.size()]);
+ }
+
boolean ignoreUnrecognized = false;
for (String arg : args) {
if (arg.equals("--ignore-unrecognized-flags")) {
« no previous file with comments | « no previous file | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698