Skip to content

Commit d43c9b4

Browse files
committed
Oops, provide defaults (should have run tests — lesson learned)
1 parent 51bdea1 commit d43c9b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Src/CommandLineParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ private static Func<int, ConsoleColoredString> getHelpGenerator(Type type, Func<
592592
var helpString = new List<ConsoleColoredString>();
593593
var commandNameAttr = type.GetCustomAttributes<CommandNameAttribute>().FirstOrDefault();
594594
string commandName = commandNameAttr == null ? Process.GetCurrentProcess().ProcessName : "... " + commandNameAttr.Names.OrderByDescending(c => c.Length).First();
595-
var fmtOpt = type.GetCustomAttribute<HelpScreenFormattingAttribute>();
595+
var fmtOpt = type.GetCustomAttribute<HelpScreenFormattingAttribute>() ?? new HelpScreenFormattingAttribute();
596596

597597
//
598598
// ## CONSTRUCT THE “USAGE” LINE

0 commit comments

Comments
 (0)