Page MenuHomeFreeBSD

diff: add support for --help and --version
ClosedPublic

Authored by thj on Mar 9 2022, 11:19 AM.

Details

Summary

Add support for --help and --version to be compatible with gnu diff.

gnu diff --help writes to stdout, do the same to be compatible

Test Plan

Test suite was run and no failures found

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 44731
Build 41619: arc lint + arc unit

Event Timeline

thj requested review of this revision.Mar 9 2022, 11:19 AM

A tiny nit with the mdoc syntax, otherwise it looks good to me.

usr.bin/diff/diff.1
315

A macro missed its stop on the chair-keyboard bus. ;)

pauamma added inline comments.
usr.bin/diff/diff.1
288

Worth mentioning "to standard output"? I'm on the fence on this.

315

A macro missed its stop on the chair-keyboard bus. ;)

Or maybe 2 collided causing a wreck. gdiff(1) says "-v, --version"

316

Same question as for --help.

usr.bin/diff/diff.c
56

For full compatibility, also needs to support -v as a --version synonym here and *gestures vaguely toward the switch statement below*

thj marked 4 inline comments as done.

Update based on man page feedback

This revision is now accepted and ready to land.Mar 10 2022, 1:38 PM

I can only see the man-page change, should I be seeing code changes in this diff as well?

Add back the code changes

This revision now requires review to proceed.Mar 10 2022, 2:37 PM

Yeah, wrong diff point with arc diff, I am sure arcanist wasn't this much trouble to use before

This revision is now accepted and ready to land.Mar 10 2022, 3:05 PM
This revision was automatically updated to reflect the committed changes.

Is there a reason for adding only --version and not the short flag synonym -v?