From ce59a2544b5c2a2036d889da2ea07e25837b50d0 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 29 Apr 2025 22:55:43 +0200 Subject: [PATCH] fix: formatter.short_name_max_len for symlink --- tiramisu_cmdline_parser/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiramisu_cmdline_parser/api.py b/tiramisu_cmdline_parser/api.py index c7103a0..e80ef9d 100644 --- a/tiramisu_cmdline_parser/api.py +++ b/tiramisu_cmdline_parser/api.py @@ -209,7 +209,7 @@ class TiramisuHelpFormatter: # Remove empty OD if ( self.formatter.remove_empty_od - and len(self.items) == 1 + and 0 < len(self.items) <= self.formatter.short_name_max_len and self.items[0][0].__name__ == "_format_text" ): return "" @@ -326,6 +326,7 @@ class TiramisuCmdlineParser(ArgumentParser): "TiramisuHelpFormatter", (TiramisuHelpFormatter, formatter_class), {} ) formatter_class.remove_empty_od = self.remove_empty_od + formatter_class.short_name_max_len = self.short_name_max_len kwargs["formatter_class"] = formatter_class if not _forhelp and self.unrestraint: subconfig = self.config.unrestraint