git: fb499259997c - main - split: Update synopsis and usage; fix examples

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Tue, 18 Apr 2023 13:30:36 UTC
The branch main has been updated by 0mp:

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

commit fb499259997c0bfd724b7b67578035cd977ef60f
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2023-04-14 11:50:13 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2023-04-18 13:30:00 +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.
---
 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 4d5f4a1a0753..14ea2eec8dad 100644
--- a/usr.bin/split/split.1
+++ b/usr.bin/split/split.1
@@ -28,7 +28,7 @@
 .\"	@(#)split.1	8.3 (Berkeley) 4/16/94
 .\" $FreeBSD$
 .\"
-.Dd October 25, 2022
+.Dd April 18, 2023
 .Dt SPLIT 1
 .Os
 .Sh NAME
@@ -36,12 +36,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
@@ -51,12 +51,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
@@ -186,7 +186,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 091c914ba8f7..5d6cbe138d38 100644
--- a/usr.bin/split/split.c
+++ b/usr.bin/split/split.c
@@ -395,9 +395,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);
 }