Skip to content

Commit

Permalink
fix(help): Don't style newlines
Browse files Browse the repository at this point in the history
Windows will style all blank space until the end of line (sometimes).

Fixes #4431
  • Loading branch information
epage committed Mar 16, 2023
1 parent e78bba0 commit fcd6a65
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/output/help_template.rs
Original file line number Diff line number Diff line change
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 fcd6a65

Please sign in to comment.