When using the "Usage" attribute together with a 2nd one (e.g. ExcludeFromCoverage) like this:
[Usage]
[ExcludeFromCodeCoverage]
public static IEnumerable<Example> Examples ...
In this situation displaying "help" will cause an exception.
The cause for that is likely fixed by this change:
src/CommandLine/Core/ReflectionExtensions.cs: L45
public static Maybe<Tuple<PropertyInfo, UsageAttribute>> GetUsageData(this Type type)
{
return
(from pi in type.FlattenHierarchy().SelectMany(x => x.GetTypeInfo().GetProperties())
let attrs = pi.GetCustomAttributes(true)
where attrs.OfType<UsageAttribute>().Any()
select Tuple.Create(pi, (UsageAttribute)attrs.OfType<UsageAttribute>().First()))
.SingleOrDefault()
.ToMaybe();
}
When using the "Usage" attribute together with a 2nd one (e.g. ExcludeFromCoverage) like this:
In this situation displaying "help" will cause an exception. The cause for that is likely fixed by this change:
src/CommandLine/Core/ReflectionExtensions.cs: L45