LoadResponseFile (responseFile);
}
foreach (string s in flatArguments) {
- if (s [0] == '/') {
- ParseFlatArgument (s);
- } else
+ if (s [0] != '/' || !ParseFlatArgument (s))
remainingArguments.Add (s);
}
if (remainingArguments.Count == 0) {
}
}
- private void LoadResponseFile (string filename)
+ void LoadResponseFile (string filename)
{
StreamReader sr = null;
string line;
for (int i = 0; i < t; i++) {
char c = line [i];
+ if (c == '#')
+ // comment, ignore rest of the line
+ break;
+
if (c == '"' || c == '\'') {
char end = c;
}
}
- private void ParseFlatArgument (string s)
+ private bool ParseFlatArgument (string s)
{
switch (s) {
case "/help":
default:
if (s.StartsWith ("/target:") || s.StartsWith ("/t:")) {
ProcessTarget (s);
- }
- if (s.StartsWith ("/property:") || s.StartsWith ("/p:")) {
- ProcessProperty (s);
- }
- if (s.StartsWith ("/logger:") || s.StartsWith ("/l:")) {
+ } else if (s.StartsWith ("/property:") || s.StartsWith ("/p:")) {
+ if (!ProcessProperty (s))
+ return false;
+ } else if (s.StartsWith ("/logger:") || s.StartsWith ("/l:")) {
ProcessLogger (s);
- }
- if (s.StartsWith ("/verbosity:") || s.StartsWith ("/v:")) {
+ } else if (s.StartsWith ("/verbosity:") || s.StartsWith ("/v:")) {
ProcessVerbosity (s);
- }
- if (s.StartsWith ("/consoleloggerparameters:") || s.StartsWith ("/clp:")) {
+ } else if (s.StartsWith ("/consoleloggerparameters:") || s.StartsWith ("/clp:")) {
ProcessConsoleLoggerParameters (s);
- }
- if (s.StartsWith ("/validate:") || s.StartsWith ("/val:")) {
+ } else if (s.StartsWith ("/validate:") || s.StartsWith ("/val:")) {
ProcessValidate (s);
- }
+ } else
+ return false;
break;
}
+
+ return true;
}
internal void ProcessTarget (string s)
targets = temp [1].Split (';');
}
- internal void ProcessProperty (string s)
+ internal bool ProcessProperty (string s)
{
string[] parameter, splittedProperties, property;
parameter = s.Split (':');
+ if (parameter.Length != 2) {
+ ErrorUtilities.ReportError (5, "Property name and value expected as /p:<prop name>=<prop value>");
+ return false;
+ }
+
splittedProperties = parameter [1].Split (';');
foreach (string st in splittedProperties) {
+ if (st.IndexOf ('=') < 0) {
+ ErrorUtilities.ReportError (5,
+ "Invalid syntax. Property name and value expected as " +
+ "<prop name>=[<prop value>]");
+ return false;
+ }
property = st.Split ('=');
- properties.AddNewProperty (property [0], property [1]);
+ properties.SetProperty (property [0], property.Length == 2 ? property [1] : "");
}
+
+ return true;
}
internal void ProcessLogger (string s)