Nov 5, 2012 at 3:06 PM
Edited Nov 5, 2012 at 4:42 PM
I added functionality that I felt might be useful to add into the actual library. Very very simple change.
Essentially what I wanted was the ability to have multiple arguments of the same type and compile them into a list. So instead of having:
It can also now do:
-o Option1 -o Option2 -o Option3
This allows me to make dynamic argument creation much easier. I have a dynamic process that can load modules which may take arguments of their own. So instead of having to combine all of their own arguments into a single -o argument and then further parse
it I can make it so that an argument for one module might use
All I did was alter SetValueList in OptionInfo. Instead of just having this line _property.SetValue(options, new List<string>(), null); which will continually reinitialize the property. Instead I check to see if the value is null, if it is, it initializes
it with that same line, otherwise it skips the initialization.
var currentValue = _property.GetValue(options, null);
if (currentValue == null)
_property.SetValue(options, new List<string>(), null);
Works great for me. Thanks.