private static void SetOptionsToMember(MemberInfo member, Options options, ICommandLine cmdLine)
{
var optionName = member.Name;
var attrs = member.GetCustomAttributes(typeof (OptionAttribute), false);
if (attrs.Length > 0) {
var attr = (OptionAttribute) attrs[0];
optionName = attr.Name;
if (String.IsNullOrEmpty(optionName))
optionName = attr.LongName;
if (String.IsNullOrEmpty(optionName))
optionName = member.Name;
}
if (cmdLine.HasOption(optionName)) {
var value = cmdLine.GetOptionValue(optionName);
}
}