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)
Oct 19 2024, 7:01 AM
Unknown Object (File)
Oct 19 2024, 6:15 AM
Unknown Object (File)
Oct 3 2024, 1:50 PM
Unknown Object (File)
Oct 1 2024, 7:03 AM
Unknown Object (File)
Sep 28 2024, 12:38 AM
Unknown Object (File)
Sep 27 2024, 9:20 AM
Unknown Object (File)
Sep 24 2024, 2:35 PM
Unknown Object (File)
Sep 21 2024, 6:06 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?