Skip to content

Commit 083fca2

Browse files
author
Hadil Ap. dos Santos Junior
committed
Added localized MetaName, issue commandlineparser#728
1 parent 9a54d78 commit 083fca2

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/CommandLine/BaseAttribute.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public abstract class BaseAttribute : Attribute
1313
private int max;
1414
private object @default;
1515
private Infrastructure.LocalizableAttributeProperty helpText;
16-
private string metaValue;
16+
private Infrastructure.LocalizableAttributeProperty metaValue;
1717
private Type resourceType;
1818

1919
/// <summary>
@@ -24,7 +24,7 @@ protected internal BaseAttribute()
2424
min = -1;
2525
max = -1;
2626
helpText = new Infrastructure.LocalizableAttributeProperty(nameof(HelpText));
27-
metaValue = string.Empty;
27+
metaValue = new Infrastructure.LocalizableAttributeProperty(nameof(MetaValue));
2828
resourceType = null;
2929
}
3030

@@ -101,16 +101,8 @@ public string HelpText
101101
/// </summary>
102102
public string MetaValue
103103
{
104-
get { return metaValue; }
105-
set
106-
{
107-
if (value == null)
108-
{
109-
throw new ArgumentNullException("value");
110-
}
111-
112-
metaValue = value;
113-
}
104+
get => metaValue.Value ?? string.Empty;
105+
set => metaValue.Value = value ?? throw new ArgumentNullException("value");
114106
}
115107

116108
/// <summary>

0 commit comments

Comments
 (0)