Skip to content

Commit 6b5aee0

Browse files
committed
.
1 parent 3952656 commit 6b5aee0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

NLyric/System/Cli/CommandLine.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ private static bool TryGetArgumentInfos(Type type, out Dictionary<string, Argume
120120

121121
argumentInfos = new Dictionary<string, ArgumentInfo>();
122122
foreach (var propertyInfo in propertyInfos) {
123-
124123
if (!VerifyProperty(propertyInfo, out var attribute)) {
125124
argumentInfos = null;
126125
return false;
@@ -150,12 +149,13 @@ private static bool VerifyProperty(PropertyInfo propertyInfo, out ArgumentAttrib
150149
argumentAttribute = null;
151150
return false;
152151
}
153-
foreach (char item in argumentAttribute.Name)
152+
foreach (char item in argumentAttribute.Name) {
154153
if (!((item >= 'a' && item <= 'z') || (item >= 'A' && item <= 'Z') || (item >= '0' && item <= '9') || item == '-' || item == '_')) {
155154
// 检查参数名是否合法
156155
argumentAttribute = null;
157156
return false;
158157
}
158+
}
159159
if (argumentAttribute.IsRequired && !(argumentAttribute.DefaultValue is null)) {
160160
// 是必选参数但有默认值
161161
argumentAttribute = null;

0 commit comments

Comments
 (0)