mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
Check for default value before writing property values
Previous version was overwriting values that might have been set via a property initializer. Closes #422
This commit is contained in:

committed by
Patrik Svensson

parent
21f731ebd5
commit
ebb1076dd0
@ -10,7 +10,10 @@ namespace Spectre.Console.Cli
|
||||
|
||||
foreach (var (parameter, value) in lookup)
|
||||
{
|
||||
parameter.Property.SetValue(settings, value);
|
||||
if (value != default)
|
||||
{
|
||||
parameter.Property.SetValue(settings, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate the settings.
|
||||
|
Reference in New Issue
Block a user