git: a721afaf8543 - stable/13 - split: Update synopsis and usage; fix examples

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Thu, 14 Sep 2023 15:00:31 UTC
The branch stable/13 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=a721afaf85437708ae45a5b3baaa6915f0f1aba0

commit a721afaf85437708ae45a5b3baaa6915f0f1aba0
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2023-04-14 11:50:13 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-09-14 14:59:52 +0000

    split: Update synopsis and usage; fix examples
    
    - Mark -d as an optional flag
    - Add a prompt to one of the examples for consistency
    - Add -d to the usage message
    
    Sponsored by:   Klara Inc.
    
    (cherry picked from commit fb499259997c0bfd724b7b67578035cd977ef60f)
---
 usr.bin/split/split.1 | 12 ++++++------
 usr.bin/split/split.c |  8 ++++----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/usr.bin/split/split.1 b/usr.bin/split/split.1
index 55f9e4f65234..6dba7489a83d 100644
--- a/usr.bin/split/split.1
+++ b/usr.bin/split/split.1
@@ -27,7 +27,7 @@
 .\"
 .\"	@(#)split.1	8.3 (Berkeley) 4/16/94
 .\"
-.Dd October 25, 2022
+.Dd April 18, 2023
 .Dt SPLIT 1
 .Os
 .Sh NAME
@@ -35,12 +35,12 @@
 .Nd split a file into pieces
 .Sh SYNOPSIS
 .Nm
-.Fl d
+.Op Fl d
 .Op Fl l Ar line_count
 .Op Fl a Ar suffix_length
 .Op Ar file Op Ar prefix
 .Nm
-.Fl d
+.Op Fl d
 .Fl b Ar byte_count Ns
 .Oo
 .Sm off
@@ -50,12 +50,12 @@
 .Op Fl a Ar suffix_length
 .Op Ar file Op Ar prefix
 .Nm
-.Fl d
+.Op Fl d
 .Fl n Ar chunk_count
 .Op Fl a Ar suffix_length
 .Op Ar file Op Ar prefix
 .Nm
-.Fl d
+.Op Fl d
 .Fl p Ar pattern
 .Op Fl a Ar suffix_length
 .Op Ar file Op Ar prefix
@@ -185,7 +185,7 @@ $ echo -e "This is 22 bytes long" | split -d -b10
 .Pp
 Split input generating 6 files:
 .Bd -literal -offset indent
-echo -e "This is 22 bytes long" | split -n 6
+$ echo -e "This is 22 bytes long" | split -n 6
 .Ed
 .Pp
 Split input creating a new file every time a line matches the regular expression
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c
index 96cad28cb1e5..29ee0581d071 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -393,9 +393,9 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-"usage: split [-l line_count] [-a suffix_length] [file [prefix]]\n"
-"       split -b byte_count[K|k|M|m|G|g] [-a suffix_length] [file [prefix]]\n"
-"       split -n chunk_count [-a suffix_length] [file [prefix]]\n"
-"       split -p pattern [-a suffix_length] [file [prefix]]\n");
+"usage: split [-d] [-l line_count] [-a suffix_length] [file [prefix]]\n"
+"       split [-d] -b byte_count[K|k|M|m|G|g] [-a suffix_length] [file [prefix]]\n"
+"       split [-d] -n chunk_count [-a suffix_length] [file [prefix]]\n"
+"       split [-d] -p pattern [-a suffix_length] [file [prefix]]\n");
 	exit(EX_USAGE);
 }