aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Piotrowski <0mp@FreeBSD.org>2026-09-23 14:19:05 +0000
committerMateusz Piotrowski <0mp@FreeBSD.org>2026-09-23 14:41:57 +0000
commit14c7492637ec0644b5bb88da114e8cc76b9bf629 (patch)
treeddd9b6aacecd547c8d7f0cf7a5a48ef39dea100d
parent30ed27ff2556c591a1791105d1dfe7464d3f5b80 (diff)
sdiff.1: Document exit status and --help
MFC after: 3 days Approved by: bnovkov (mentor) Sponsored by: fme AG Differential Revision: https://reviews.freebsd.org/D59927
-rw-r--r--usr.bin/sdiff/sdiff.123
-rw-r--r--usr.bin/sdiff/sdiff.c1
2 files changed, 23 insertions, 1 deletions
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 <ray@cyth.net>.
.\" 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.",