git: 1fadced1c869 - stable/14 - sdiff.1: Document exit status and --help
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 01 Oct 2026 08:09:03 UTC
The branch stable/14 has been updated by 0mp:
URL: https://cgit.FreeBSD.org/src/commit/?id=1fadced1c8695631b363bc56a06123bd8111d9bf
commit 1fadced1c8695631b363bc56a06123bd8111d9bf
Author: Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2026-09-23 14:19:05 +0000
Commit: Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2026-10-01 08:08:16 +0000
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
(cherry picked from commit 14c7492637ec0644b5bb88da114e8cc76b9bf629)
---
usr.bin/sdiff/sdiff.1 | 23 ++++++++++++++++++++++-
usr.bin/sdiff/sdiff.c | 1 +
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/usr.bin/sdiff/sdiff.1 b/usr.bin/sdiff/sdiff.1
index ca6594c6479a..4e43a8c08c28 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 daa0f43e0b0e..b991699bceb3 100644
--- a/usr.bin/sdiff/sdiff.c
+++ b/usr.bin/sdiff/sdiff.c
@@ -118,6 +118,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.",