diff --git a/usr.bin/sdiff/sdiff.1 b/usr.bin/sdiff/sdiff.1 index e228ece64331..ced741eec31e 100644 --- a/usr.bin/sdiff/sdiff.1 +++ b/usr.bin/sdiff/sdiff.1 @@ -3,7 +3,7 @@ .\" Written by Raymond Lai . .\" Public domain. .\" -.Dd February 16, 2024 +.Dd September 23, 2026 .Dt SDIFF 1 .Os .Sh NAME @@ -17,6 +17,8 @@ .Op Fl w Ar width .Ar file1 .Ar file2 +.Nm sdiff +.Fl -help .Sh DESCRIPTION .Nm displays two files side by side, @@ -85,6 +87,8 @@ Print a maximum of .Ar width characters on each line. The default is 130 characters. +.It Fl -help +Print the usage message and exit. .El .Pp Options passed to @@ -153,6 +157,23 @@ Specifies a directory for temporary files to be created. The default is .Pa /tmp . .El +.Sh EXIT STATUS +The +.Nm +utility exits with one of the following values: +.Pp +.Bl -tag -width Ds -offset indent -compact +.It 0 +No differences were found. +.It 1 +Differences were found. +.It >1 +An error occurred. +.El +.Pp +The +.Fl -help +option exits with a status of 0. .Sh SEE ALSO .Xr cmp 1 , .Xr diff 1 , diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index b796bb4224a8..628e6cde46d9 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -117,6 +117,7 @@ static struct option longopts[] = { static const char *help_msg[] = { "usage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 file2\n", + " sdiff --help\n", "-l, --left-column: only print the left column for identical lines.", "-o OUTFILE, --output=OUTFILE: interactively merge file1 and file2 into outfile.", "-s, --suppress-common-lines: skip identical lines.",