You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
UBT: Fix parsing of nullable arguments passed via command line arguments.
#rb none [fyi] pj.kack #rnx (ushell-p4-cherrypick of 8382982 by Ben.Marsh) [CL 8395389 by PJ Kack in Dev-Core branch]
This commit is contained in:
@@ -593,11 +593,18 @@ namespace Tools.DotNETCommon
|
||||
IEnumerable<CommandLineAttribute> Attributes = FieldInfo.GetCustomAttributes<CommandLineAttribute>();
|
||||
foreach(CommandLineAttribute Attribute in Attributes)
|
||||
{
|
||||
// Get the inner field type, unwrapping nullable types
|
||||
Type ValueType = FieldInfo.FieldType;
|
||||
if(ValueType.IsGenericType && ValueType.GetGenericTypeDefinition() == typeof(Nullable<>))
|
||||
{
|
||||
ValueType = ValueType.GetGenericArguments()[0];
|
||||
}
|
||||
|
||||
// Get the appropriate prefix for this attribute
|
||||
string Prefix = Attribute.Prefix;
|
||||
if(Prefix == null)
|
||||
{
|
||||
if(FieldInfo.FieldType == typeof(bool))
|
||||
if(ValueType == typeof(bool))
|
||||
{
|
||||
Prefix = String.Format("-{0}", FieldInfo.Name);
|
||||
}
|
||||
@@ -608,7 +615,7 @@ namespace Tools.DotNETCommon
|
||||
}
|
||||
else
|
||||
{
|
||||
if(FieldInfo.FieldType != typeof(bool) && Attribute.Value == null && !Prefix.EndsWith("=") && !Prefix.EndsWith(":"))
|
||||
if(ValueType != typeof(bool) && Attribute.Value == null && !Prefix.EndsWith("=") && !Prefix.EndsWith(":"))
|
||||
{
|
||||
Prefix = Prefix + "=";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user