You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maximum length for displaying help is 120 in Parser.Default. If a long help text makes the computed length larger than that (when reporting a parsing error), an ArgumentOutOfRangeException is raised.
Details:
In HelpText.AddOptionsImpl, maxLength = GetMaxLength(specifications) is large enough so that remainingSpace below becomes negative, which is passed to HelpText.AddOption as widthOfHelpText, and used there with an exception.
If I manually set the negative remainingSpace to 0 in the debugger, it goes on to an out of memory error. Setting to 1 is ok, but illogical, so there must be another hidden bug that 0 reveals.
Also, this error only occurs with Parser.Default. If I use an unmodified new Parser(s => Console.WriteLine(s.MaximumDisplayWidth)), this prints 120, the same result is returned (error list), but without crashing. So this behaviour also depends on another setting than the maximum length.
The text was updated successfully, but these errors were encountered:
I was also seeing ArgumentOutOfRangeException related to MaximumDisplayWidth. It seems that old versions of mono for non-Windows systems would throw when Console.Width is called, but for newer versions of Mono this is not the case. See #279
Maximum length for displaying help is 120 in
Parser.Default
. If a long help text makes the computed length larger than that (when reporting a parsing error), anArgumentOutOfRangeException
is raised.Details:
In
HelpText.AddOptionsImpl
,maxLength = GetMaxLength(specifications)
is large enough so thatremainingSpace
below becomes negative, which is passed toHelpText.AddOption
aswidthOfHelpText
, and used there with an exception.If I manually set the negative
remainingSpace
to 0 in the debugger, it goes on to an out of memory error. Setting to 1 is ok, but illogical, so there must be another hidden bug that 0 reveals.Also, this error only occurs with
Parser.Default
. If I use an unmodifiednew Parser(s => Console.WriteLine(s.MaximumDisplayWidth))
, this prints 120, the same result is returned (error list), but without crashing. So this behaviour also depends on another setting than the maximum length.The text was updated successfully, but these errors were encountered: