Skip to content

Commit

Permalink
Merge pull request #4767 from epage/win-ansi
Browse files Browse the repository at this point in the history
fix(help): Don't style newlines
  • Loading branch information
epage committed Mar 18, 2023
2 parents e78bba0 + fcd6a65 commit cdff815
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/output/help_template.rs
Expand Up @@ -368,7 +368,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);
}
Expand All @@ -379,7 +380,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);
}

Expand All @@ -388,7 +390,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() {
Expand All @@ -410,7 +413,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);
}
}
Expand Down

0 comments on commit cdff815

Please sign in to comment.