Skip to content

Commit d71a4df

Browse files
committed
pass arg dictionary to Arguments(), make constructor private again
1 parent 4100fdf commit d71a4df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Utility.CommandLine.Arguments/Arguments.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ public class Arguments
152152
/// </remarks>
153153
private const string StrictOperandSplitRegEx = "(.*?[^\\\"\\\'])?(\\B-{2}\\B)[^\\\"\\\']?(.*)";
154154

155-
public Arguments(string commandLineString, List<KeyValuePair<string, string>> argumentList, List<string> operandList, Type targetType = null)
155+
private Arguments(string commandLineString, List<KeyValuePair<string, string>> argumentList, Dictionary<string, object> argumentDictionary, List<string> operandList, Type targetType = null)
156156
{
157157
CommandLineString = commandLineString;
158158
ArgumentList = argumentList;
159-
ArgumentDictionary = GetArgumentDictionary(argumentList, targetType);
159+
ArgumentDictionary = argumentDictionary;
160160
OperandList = operandList;
161161
TargetType = targetType;
162162
}
@@ -324,7 +324,8 @@ private static Dictionary<string, object> GetArgumentDictionary(List<KeyValuePai
324324
operandList = GetOperandList(commandLineString);
325325
}
326326

327-
return new Arguments(commandLineString, argumentList, operandList, type);
327+
var argumentDictionary = GetArgumentDictionary(argumentList, type);
328+
return new Arguments(commandLineString, argumentList, argumentDictionary, operandList, type);
328329
}
329330

330331
/// <summary>

0 commit comments

Comments
 (0)