aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Piotrowski <0mp@FreeBSD.org>2023-04-14 11:50:13 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2023-09-14 14:59:52 +0000
commita721afaf85437708ae45a5b3baaa6915f0f1aba0 (patch)
tree3bcdaafeeb97350d0867715cc4883d724fb311e8
parent62d509951cb97265156d232c3f720161d8ccd016 (diff)
downloadsrc-a721afaf85437708ae45a5b3baaa6915f0f1aba0.tar.gz
src-a721afaf85437708ae45a5b3baaa6915f0f1aba0.zip
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)
-rw-r--r--usr.bin/split/split.112
-rw-r--r--usr.bin/split/split.c8
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);
}