From e5d82583cb7e2e1e8c641b5309b88717aba4a9a7 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 16 Mar 2023 15:38:56 -0500 Subject: [PATCH] fix(help): Don't style newlines Windows will style all blank space until the end of line (sometimes). Fixes #4431 --- src/output/help_template.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/output/help_template.rs b/src/output/help_template.rs index b8f2705404ea..81a265e564af 100644 --- a/src/output/help_template.rs +++ b/src/output/help_template.rs @@ -365,7 +365,8 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> { .get_subcommand_help_heading() .unwrap_or(&default_help_heading), ); - self.header(":\n"); + self.header(":"); + self.none("\n"); self.write_subcommands(self.cmd); } @@ -376,7 +377,8 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> { } first = false; // Write positional args if any - self.header("Arguments:\n"); + self.header("Arguments:"); + self.none("\n"); self.write_args(&pos, "Arguments", positional_sort_key); } @@ -385,7 +387,8 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> { self.none("\n\n"); } first = false; - self.header("Options:\n"); + self.header("Options:"); + self.none("\n"); self.write_args(&non_pos, "Options", option_sort_key); } if !custom_headings.is_empty() { @@ -407,7 +410,9 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> { self.none("\n\n"); } first = false; - self.header(format!("{heading}:\n")); + self.header(heading); + self.header(":"); + self.none("\n"); self.write_args(&args, heading, option_sort_key); } }