[mcs] Accept and ignore command line args supported by csc ..
[mono.git] / mcs / mcs / settings.cs
index 42156d77ba9ab630a1abc513ac49c84cb28aee97..7b092135a2b09601d4e7d20a7ed471aac6799ea7 100644 (file)
@@ -150,7 +150,7 @@ namespace Mono.CSharp {
                public bool BreakOnInternalError;
                #endregion
 
-               public string GetResourceStrings;
+               public List<string> GetResourceStrings;
 
                public bool ShowFullPaths;
 
@@ -583,15 +583,21 @@ namespace Mono.CSharp {
                {
                        bool valid = true;
                        foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {
+                               var warning = wid;
+                               if (warning.Length == 6 && warning [0] == 'C' && warning [1] == 'S')
+                                       warning = warning.Substring (2);
+
                                int id;
-                               if (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) {
-                                       report.Error (1904, "`{0}' is not a valid warning number", wid);
-                                       valid = false;
+                               if (!int.TryParse (warning, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) {
                                        continue;
                                }
 
-                               if (report.CheckWarningCode (id, Location.Null))
+                               if (report.CheckWarningCode (id, Location.Null)) {
                                        action (id);
+                               } else {
+                                       report.Error (1904, "`{0}' is not a valid warning number", wid);
+                                       valid = false;
+                               }
                        }
 
                        return valid;
@@ -1204,6 +1210,14 @@ namespace Mono.CSharp {
                                settings.RuntimeMetadataVersion = value;
                                return ParseResult.Success;
 
+                       // csc options that we don't support
+                       case "/utf8output":
+                       case "/subsystemversion":
+                       case "/highentropyva":
+                       case "/highentropyva+":
+                       case "/highentropyva-":
+                               return ParseResult.Success;
+
                        default:
                                return ParseResult.UnknownOption;
                        }
@@ -1485,7 +1499,10 @@ namespace Mono.CSharp {
                                                return ParseResult.Error;
                                        }
 
-                                       settings.GetResourceStrings = file;
+                                       if (settings.GetResourceStrings == null)
+                                               settings.GetResourceStrings = new List<string> ();
+
+                                       settings.GetResourceStrings.Add (file);
                                        return ParseResult.Success;
                                }
 
@@ -1558,7 +1575,7 @@ namespace Mono.CSharp {
                                "   -help                Lists all compiler options (short: -?)\n" +
                                "   -keycontainer:NAME   The key pair container used to sign the output assembly\n" +
                                "   -keyfile:FILE        The key file used to strongname the ouput assembly\n" +
-                               "   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Future\n" +
+                               "   -langversion:TEXT    Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Experimental\n" +
                                "   -lib:PATH1[,PATHn]   Specifies the location of referenced assemblies\n" +
                                "   -main:CLASS          Specifies the class with the Main method (short: -m)\n" +
                                "   -noconfig            Disables implicitly referenced assemblies\n" +