diff options
author | keramida <keramida@FreeBSD.org> | 2006-08-08 21:25:22 +0000 |
---|---|---|
committer | keramida <keramida@FreeBSD.org> | 2006-08-08 21:25:22 +0000 |
commit | 7d23f1583e6ad8f51cc1aecedac76d865aeeed03 (patch) | |
tree | 616ff8a9a61a4572d2b05477d174bf3fe81d1bce /usr.bin/split/split.c | |
parent | 2d628bb4d98b991fc187a29462ce204e463b7166 (diff) | |
download | FreeBSD-src-7d23f1583e6ad8f51cc1aecedac76d865aeeed03.zip FreeBSD-src-7d23f1583e6ad8f51cc1aecedac76d865aeeed03.tar.gz |
Update usage & SYNOPSIS and clarify that input files are not removed.
Sort getopt option handling of -p too, while here.
The changes are adapted from a patch by Ruslan Ermilov, posted as
followup to docs/33852.
PR: docs/33852
Submitted by: Gary W. Swearingen <swear@blarg.net>
MFC after: 1 week
Diffstat (limited to 'usr.bin/split/split.c')
-rw-r--r-- | usr.bin/split/split.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index 906d07a..71b47c7 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -130,11 +130,6 @@ main(int argc, char **argv) errx(EX_USAGE, "%s: offset too large", optarg); bytecnt = (off_t)(bytecnti * scale); break; - case 'p' : /* pattern matching. */ - if (regcomp(&rgx, optarg, REG_EXTENDED|REG_NOSUB) != 0) - errx(EX_USAGE, "%s: illegal regexp", optarg); - pflag = 1; - break; case 'l': /* Line count. */ if (numlines != 0) usage(); @@ -142,6 +137,11 @@ main(int argc, char **argv) errx(EX_USAGE, "%s: illegal line count", optarg); break; + case 'p': /* pattern matching. */ + if (regcomp(&rgx, optarg, REG_EXTENDED|REG_NOSUB) != 0) + errx(EX_USAGE, "%s: illegal regexp", optarg); + pflag = 1; + break; default: usage(); } @@ -335,8 +335,8 @@ static void usage(void) { (void)fprintf(stderr, -"usage: split [-a sufflen] [-b byte_count] [-l line_count] [-p pattern]\n"); - (void)fprintf(stderr, -" [file [prefix]]\n"); +"usage: split [-l line_count] [-a suffix_length] [file [prefix]]\n" +" split -b byte_count[k|m] [-a suffix_length] [file [prefix]]\n" +" split -p pattern [-a suffix_length] [file [prefix]]\n"); exit(EX_USAGE); } |