Skip to content

Expand and improve man page documentation - #1038

Draft
Wilfred wants to merge 1 commit into
masterfrom
claude/difft-docs-review-2lszbi
Draft

Expand and improve man page documentation#1038
Wilfred wants to merge 1 commit into
masterfrom
claude/difft-docs-review-2lszbi

Conversation

@Wilfred

@Wilfred Wilfred commented Aug 14, 2026

Copy link
Copy Markdown
Owner

This PR significantly expands the difftastic man page (difft.1) with comprehensive documentation improvements.

Summary

The man page has been substantially enhanced to provide more complete and detailed information about difftastic's usage, options, and behavior. This includes adding missing command-line syntax forms, expanding option descriptions with defaults and environment variables, and adding new sections for environment variables, exit status, and examples.

Key Changes

  • Updated man page header: Changed from generic format to include "difftastic" and "User Commands" for better categorization
  • Added missing SYNOPSIS forms: Documented the 7-argument and 9-argument calling conventions used by GIT_EXTERNAL_DIFF
  • Expanded DESCRIPTION section: Added details about directory comparison, conflict marker handling, and git integration
  • Enhanced OPTIONS documentation:
    • Added default values for all options
    • Added corresponding environment variable names for each option
    • Expanded descriptions with additional context and examples
    • Added new --override-binary option documentation
    • Improved formatting with proper code blocks for examples
  • New ENVIRONMENT section: Comprehensive documentation of environment variables, including DFT_OVERRIDE_1-9 and DFT_OVERRIDE_BINARY_1-9
  • New EXIT STATUS section: Documented exit codes (0, 1, 2) and their meanings
  • New EXAMPLES section: Added practical usage examples for common scenarios
  • New SEE ALSO section: Added references to diff(1) and git-diff(1)
  • Added DEBUG OPTIONS: Documented --dump-syntax-dot option
  • Minor text improvements: Fixed typos ("the all the" → "all the"), clarified descriptions, and improved formatting consistency

Implementation Details

  • Updated both the source markdown (difft.1.md) and generated man page (difft.1)
  • Used proper man page formatting with .RS/.RE blocks for option details
  • Converted inline code examples to proper code blocks using .EX/.EE format
  • Maintained consistency with man page conventions and formatting standards

https://claude.ai/code/session_01JxMKp5Cf3frsUq4gmGoDBA

The man page was written for 0.58 and had drifted from the actual CLI.

Correctness fixes:

* `--strip-cr` takes `on`/`off` (defaulting to `on` since 0.58), it is
  not a boolean flag.
* The `\r\n` in the `--strip-cr` description was rendering as `***` in
  the generated roff.
* The `--override` environment variable example was mangled: the
  unbalanced `*` in `'*.c:text'` opened emphasis that spanned lines, so
  the three `export` lines were run together and `*.c` lost its `*`.
  Shell examples are now code blocks, so globs and straight quotes
  survive verbatim.
* `--graph-limit` describes the internal graph in terms of vertices, as
  `--help` does.
* `--tab-width` takes `NUM_SPACES`, not `NUMSPACES`.
* `--display=json` requires `DFT_UNSTABLE` to be set.
* Fixed "Print the all the languages" in `--list-languages`.

Freshness:

* Document `--override-binary` (added in 0.65) and `--dump-syntax-dot`.
* Document the default value and permitted values of every option.
* Set the `.TH` manual section, so the rendered header is no longer
  blank.

Helpfulness:

* Document the environment variable for each option, plus an
  ENVIRONMENT section covering `DFT_OVERRIDE_1` to `DFT_OVERRIDE_9`,
  `DFT_OVERRIDE_BINARY_1` to `DFT_OVERRIDE_BINARY_9` and
  `DFT_UNSTABLE`.
* Add EXIT STATUS, EXAMPLES and SEE ALSO sections.
* Cover stdin, `/dev/null` and the GIT_EXTERNAL_DIFF argument forms in
  the synopsis and description.

difft.1 was regenerated with `just man` using pandoc 3.1.13, which is
the version that generated the previous difft.1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JxMKp5Cf3frsUq4gmGoDBA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants