From 51298f5d43f6d1f5077635e3141b24fc23688c6c Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Mon, 12 Feb 2024 01:19:06 -0600 Subject: [PATCH] Fix extra whitespace in help message (#28) The extra space only appears when a `#[footer]` attr is not used. It shows up as three blank lines instead of two. --- onlyargs_derive/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/onlyargs_derive/src/lib.rs b/onlyargs_derive/src/lib.rs index a784828..acbb28e 100644 --- a/onlyargs_derive/src/lib.rs +++ b/onlyargs_derive/src/lib.rs @@ -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() { @@ -369,7 +369,6 @@ pub fn derive_parser(input: TokenStream) -> TokenStream { "\nOptions:\n", {options_help:?}, {positional_help:?}, - "\n", {footer:?}, "\n", );