From 81c88ba1d6b9f21f617787beb7ab1da39745db0c Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Mon, 6 Oct 2025 23:10:41 +0100 Subject: [PATCH] Document git diff conventions in --help --- src/options.rs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/options.rs b/src/options.rs index d2090672b..f6148bdf2 100644 --- a/src/options.rs +++ b/src/options.rs @@ -108,8 +108,27 @@ fn app() -> clap::Command { .to_string(), ); - after_help.push_str("\n\nDifftastic can also be invoked with 7 arguments in the format that GIT_EXTERNAL_DIFF expects.\n\n"); - after_help.push_str("See the full manual at: https://difftastic.wilfred.me.uk/"); + 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('\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("\n\nSee the full manual at: https://difftastic.wilfred.me.uk/"); Command::new("Difftastic") .override_usage(USAGE) @@ -850,7 +869,6 @@ pub(crate) fn parse_args() -> Mode { } } - // TODO: document these different ways of calling difftastic. let (display_path, lhs_path, rhs_path, lhs_permissions, rhs_permissions, renamed) = match &args [..] {