From 1d8622d0dd3127ac3c4e0dbeb946bfec1b7cee29 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Leconte Date: Sun, 24 Aug 2025 14:48:18 -0400 Subject: [PATCH 1/2] Fix HelpText unhandled PlatformNotSupportedException on non-Windows platforms --- src/CommandLine/Text/HelpText.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CommandLine/Text/HelpText.cs b/src/CommandLine/Text/HelpText.cs index f5e9a7b9..373edd78 100644 --- a/src/CommandLine/Text/HelpText.cs +++ b/src/CommandLine/Text/HelpText.cs @@ -191,7 +191,7 @@ public HelpText(SentenceBuilder sentenceBuilder, string heading, string copyrigh maximumDisplayWidth = DefaultMaximumLength; } } - catch (IOException) + catch (Exception e) when (e is IOException || e is PlatformNotSupportedException || e is ArgumentOutOfRangeException) { maximumDisplayWidth = DefaultMaximumLength; } @@ -1133,3 +1133,4 @@ private static string FormatDefaultValue(T value) } } + From fc77fcb04da71551fc1112231ff6c45d0ae1ef94 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Leconte Date: Sun, 24 Aug 2025 14:55:24 -0400 Subject: [PATCH 2/2] Remove trailing empty line --- src/CommandLine/Text/HelpText.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CommandLine/Text/HelpText.cs b/src/CommandLine/Text/HelpText.cs index 373edd78..eecd15cf 100644 --- a/src/CommandLine/Text/HelpText.cs +++ b/src/CommandLine/Text/HelpText.cs @@ -1133,4 +1133,3 @@ private static string FormatDefaultValue(T value) } } -