in WindowsDevicePortalWrapper/MockDataGenerator/ParameterHelper.cs [88:117]
public void ParseCommandLine(string[] args)
{
// Parse the command line args
for (int i = 0; i < args.Length; ++i)
{
string arg = args[i];
if (!arg.StartsWith("/") && !arg.StartsWith("-"))
{
throw new Exception(string.Format("Unrecognized argument: {0}", arg));
}
arg = arg.Substring(1);
int valueIndex = arg.IndexOf(':');
string value = null;
// If this contains a colon, seperate it into the param and value. Otherwise add it as a flag
if (valueIndex > 0)
{
value = arg.Substring(valueIndex + 1);
arg = arg.Substring(0, valueIndex);
this.parameters.Add(arg.ToLowerInvariant(), value);
}
else
{
this.flags.Add(arg.ToLowerInvariant());
}
}
}