From 5fb7684b380f3cac08a35706c305d503b10946a7 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 7 Oct 2025 09:33:53 +0100 Subject: [PATCH] Fix broken line wrapping in --help for git invocations --- src/options.rs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/options.rs b/src/options.rs index bf38bba97..988aa1829 100644 --- a/src/options.rs +++ b/src/options.rs @@ -108,25 +108,21 @@ fn app() -> clap::Command { .to_string(), ); + // For some reason clap will hard wrap these invocations weirdly + // (with extra blank lines) if we use bold. Since these are + // showing CLI formats rather than concrete values, compromise by + // not using bold. after_help.push_str("\n\nDifftastic can also be invoked with 7 or 9 arguments in the format that GIT_EXTERNAL_DIFF expects.\n\n"); - after_help.push_str( - &format!( - "$ {} DISPLAY-PATH OLD-FILE OLD-HEX OLD-MODE NEW-FILE NEW-HEX NEW-MODE", - bin_name - ) - .bold() - .to_string(), - ); + after_help.push_str(&format!( + "$ {} DISPLAY-PATH OLD-FILE OLD-HEX OLD-MODE NEW-FILE NEW-HEX NEW-MODE", + bin_name + )); after_help.push('\n'); - after_help.push_str( - &format!( - "$ {} OLD-NAME OLD-FILE OLD-HEX OLD-MODE NEW-FILE NEW-HEX NEW-MODE NEW-NAME METADATA", - bin_name - ) - .bold() - .to_string(), - ); + after_help.push_str(&format!( + "$ {} OLD-NAME OLD-FILE OLD-HEX OLD-MODE NEW-FILE NEW-HEX NEW-MODE NEW-NAME METADATA", + bin_name + )); after_help.push_str("\n\nSee the full manual at "); if std::io::stdout().is_tty() {