Page MenuHomeFreeBSD

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

Authored by thj on Mar 9 2022, 11:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 7 2024, 6:07 AM
Unknown Object (File)
Jan 30 2024, 5:07 AM
Unknown Object (File)
Jan 30 2024, 5:07 AM
Unknown Object (File)
Dec 31 2023, 6:25 PM
Unknown Object (File)
Dec 22 2023, 12:54 AM
Unknown Object (File)
Dec 13 2023, 3:40 PM
Unknown Object (File)
Dec 12 2023, 3:04 PM
Unknown Object (File)
Dec 2 2023, 8:45 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 Passed
Unit
No 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
316

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

pauamma_gundo.com added inline comments.
usr.bin/diff/diff.1
289

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

316

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

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

317

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?