Skip to content

Commit

Permalink
Fix extra whitespace in help message
Browse files Browse the repository at this point in the history
The extra space only appears when a `#[footer]` attr is not used. It
shows up as three blank lines instead of two.
  • Loading branch information
parasyte committed Feb 12, 2024
1 parent e838124 commit 2c526ba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions onlyargs_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ pub fn derive_parser(input: TokenStream) -> TokenStream {
let footer = if ast.footer.is_empty() {
String::new()
} else {
format!("\n{}\n", ast.footer.join("\n"))
format!("\n\n{}\n", ast.footer.join("\n"))
};
let bin_name = std::env::var_os("CARGO_BIN_NAME").and_then(|name| name.into_string().ok());
let help_impl = if bin_name.is_none() {
Expand Down Expand Up @@ -369,7 +369,6 @@ pub fn derive_parser(input: TokenStream) -> TokenStream {
"\nOptions:\n",
{options_help:?},
{positional_help:?},
"\n",
{footer:?},
"\n",
);
Expand Down

0 comments on commit 2c526ba

Please sign in to comment.