Add core content definitions
This commit is contained in:
@@ -81,7 +81,28 @@ public sealed class DebugSettings
|
||||
|
||||
private static bool TryParseBootMode(string value, out DebugBootMode bootMode)
|
||||
{
|
||||
return Enum.TryParse(value, true, out bootMode);
|
||||
if (Enum.TryParse(value, true, out bootMode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
string normalizedValue = NormalizeBootModeName(value);
|
||||
foreach (DebugBootMode candidate in Enum.GetValues<DebugBootMode>())
|
||||
{
|
||||
if (NormalizeBootModeName(candidate.ToString()).Equals(normalizedValue, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
bootMode = candidate;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bootMode = DebugBootMode.Menu;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string NormalizeBootModeName(string value)
|
||||
{
|
||||
return value.Replace("-", string.Empty, StringComparison.Ordinal).Replace("_", string.Empty, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private const string DebugBootModePrefix = "--debug-boot=";
|
||||
|
||||
Reference in New Issue
Block a user