proposal: print --help to stdout so it can be paged and searched #179

Open
opened 2026-11-11 01:06:07 +01:00 by clawbot · 0 comments
Collaborator

Proposal from the acceptance test (#164). It needs your decision before anyone builds it.

What is missing

--help writes to stderr, so the help text cannot be paged or searched.

Examples:

  • sfdupes scan --help | less opens an empty pager.
  • sfdupes scan --help | grep tmp filters nothing, and the whole text is printed.

This is as specified. README.md says under "Settings" that --help prints to stderr and writes nothing to stdout. That follows from the goal "Keep the streams apart": stdout holds only data for programs, and everything for a human goes to stderr. So this is a question about that goal, not a bug.

Why a user expects it

Help that was asked for is the output of the command. Command-line tools print it to stdout and exit 0, and send only the usage text of a mistaken command line to stderr. sfdupes --version already prints to stdout.

What it would take

  • --help, -h and sfdupes help print to stdout.
  • The usage text of a usage error stays on stderr, with exit 2.
  • The sentence under "Settings" in README.md changes, and so do the tests that expect help on stderr.

Your choices

  • Help on stdout: build the above.
  • Help stays on stderr: nothing changes. A user who wants to page it sends stderr into the pipe by hand.

Recommended: Help on stdout.

Model: fable-5-2

Proposal from the acceptance test (https://git.eeqj.de/sneak/sfdupes/issues/164). It needs your decision before anyone builds it. ## What is missing `--help` writes to stderr, so the help text cannot be paged or searched. Examples: - `sfdupes scan --help | less` opens an empty pager. - `sfdupes scan --help | grep tmp` filters nothing, and the whole text is printed. This is as specified. `README.md` says under "Settings" that `--help` prints to stderr and writes nothing to stdout. That follows from the goal "Keep the streams apart": stdout holds only data for programs, and everything for a human goes to stderr. So this is a question about that goal, not a bug. ## Why a user expects it Help that was asked for is the output of the command. Command-line tools print it to stdout and exit 0, and send only the usage text of a mistaken command line to stderr. `sfdupes --version` already prints to stdout. ## What it would take - `--help`, `-h` and `sfdupes help` print to stdout. - The usage text of a usage error stays on stderr, with exit 2. - The sentence under "Settings" in `README.md` changes, and so do the tests that expect help on stderr. ## Your choices - **Help on stdout**: build the above. - **Help stays on stderr**: nothing changes. A user who wants to page it sends stderr into the pipe by hand. Recommended: **Help on stdout**. Model: fable-5-2
sneak was assigned by clawbot 2026-11-11 01:06:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/sfdupes#179