2 * Copyright (c) 1992 Keith Muller.
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
6 * This code is derived from software contributed to Berkeley by
7 * Keith Muller of the University of California, San Diego.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
40 #include <sys/cdefs.h>
41 __FBSDID("$FreeBSD$");
43 #include <sys/types.h>
60 * Routines which handle command line options
63 static char flgch[] = FLGCH; /* list of all possible flags */
64 static OPLIST *ophead = NULL; /* head for format specific options -x */
65 static OPLIST *optail = NULL; /* option tail */
67 static int no_op(void);
68 static void printflg(unsigned int);
69 static int c_frmt(const void *, const void *);
70 static off_t str_offt(char *);
71 static char *getline(FILE *fp);
72 static void pax_options(int, char **);
73 static void pax_usage(void);
74 static void tar_options(int, char **);
75 static void tar_usage(void);
76 static void cpio_options(int, char **);
77 static void cpio_usage(void);
79 /* errors from getline */
80 #define GETLINE_FILE_CORRUPT 1
81 #define GETLINE_OUT_OF_MEM 2
82 static int getline_error;
85 #define GZIP_CMD "gzip" /* command to run as gzip */
86 #define COMPRESS_CMD "compress" /* command to run as compress */
87 #define BZIP2_CMD "bzip2" /* command to run as gzip */
90 * Format specific routine table - MUST BE IN SORTED ORDER BY NAME
91 * (see pax.h for description of each function)
93 * name, blksz, hdsz, udev, hlk, blkagn, inhead, id, st_read,
94 * read, end_read, st_write, write, end_write, trail,
95 * rd_data, wr_data, options
99 /* 0: OLD BINARY CPIO */
100 {"bcpio", 5120, sizeof(HD_BCPIO), 1, 0, 0, 1, bcpio_id, cpio_strd,
101 bcpio_rd, bcpio_endrd, cpio_stwr, bcpio_wr, cpio_endwr, cpio_trail,
102 NULL, rd_wrfile, wr_rdfile, bad_opt},
104 /* 1: OLD OCTAL CHARACTER CPIO */
105 {"cpio", 5120, sizeof(HD_CPIO), 1, 0, 0, 1, cpio_id, cpio_strd,
106 cpio_rd, cpio_endrd, cpio_stwr, cpio_wr, cpio_endwr, cpio_trail,
107 NULL, rd_wrfile, wr_rdfile, bad_opt},
109 /* 2: SVR4 HEX CPIO */
110 {"sv4cpio", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, vcpio_id, cpio_strd,
111 vcpio_rd, vcpio_endrd, cpio_stwr, vcpio_wr, cpio_endwr, cpio_trail,
112 NULL, rd_wrfile, wr_rdfile, bad_opt},
114 /* 3: SVR4 HEX CPIO WITH CRC */
115 {"sv4crc", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, crc_id, crc_strd,
116 vcpio_rd, vcpio_endrd, crc_stwr, vcpio_wr, cpio_endwr, cpio_trail,
117 NULL, rd_wrfile, wr_rdfile, bad_opt},
120 {"tar", 10240, BLKMULT, 0, 1, BLKMULT, 0, tar_id, no_op,
121 tar_rd, tar_endrd, no_op, tar_wr, tar_endwr, NULL, tar_trail,
122 rd_wrfile, wr_rdfile, tar_opt},
125 {"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
126 ustar_rd, tar_endrd, ustar_stwr, ustar_wr, tar_endwr, NULL, tar_trail,
127 rd_wrfile, wr_rdfile, bad_opt},
129 #define F_OCPIO 0 /* format when called as cpio -6 */
130 #define F_ACPIO 1 /* format when called as cpio -c */
131 #define F_CPIO 3 /* format when called as cpio */
132 #define F_OTAR 4 /* format when called as tar -o */
133 #define F_TAR 5 /* format when called as tar */
134 #define DEFLT 5 /* default write format from list above */
137 * ford is the archive search order used by get_arc() to determine what kind
138 * of archive we are dealing with. This helps to properly id archive formats
139 * some formats may be subsets of others....
141 int ford[] = {5, 4, 3, 2, 1, 0, -1 };
145 * figure out if we are pax, tar or cpio. Call the appropriate options
150 options(int argc, char **argv)
154 * Are we acting like pax, tar or cpio (based on argv[0])
156 if ((argv0 = strrchr(argv[0], '/')) != NULL)
161 if (strcmp(NM_TAR, argv0) == 0) {
162 tar_options(argc, argv);
165 else if (strcmp(NM_CPIO, argv0) == 0) {
166 cpio_options(argc, argv);
170 * assume pax as the default
173 pax_options(argc, argv);
179 * look at the user specified flags. set globals as required and check if
180 * the user specified a legal set of flags. If not, complain and exit
184 pax_options(int argc, char **argv)
188 unsigned int flg = 0;
189 unsigned int bflg = 0;
194 * process option flags
196 while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ"))
210 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
211 paxwarn(1, "Invalid block size %s", optarg);
217 * inverse match on patterns
224 * match only dir on extract, not the subtree at dir
231 * filename where the archive is stored
238 * interactive file rename
245 * do not clobber files that exist
252 * try to link src to dest with copy (-rw)
259 * select first match for a pattern only
266 * pass format specific options
269 if (opt_add(optarg) < 0)
274 * specify file characteristic options
276 for (pt = optarg; *pt != '\0'; ++pt) {
280 * do not preserve access time
286 * preserve user id, group id, file
287 * mode, access/modification times
296 * do not preserve modification time
308 * preserver file mode bits
313 paxwarn(1, "Invalid -p string: %c", *pt);
328 * file name substitution name pattern
330 if (rep_add(optarg) < 0) {
338 * preserve access time on file system nodes we read
345 * ignore those older files
352 * verbose operation mode
365 * specify an archive format on write
368 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
369 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL) {
373 paxwarn(1, "Unknown -x format: %s", optarg);
374 (void)fputs("pax: Known -x formats are:", stderr);
375 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
376 (void)fprintf(stderr, " %s", fsub[i].name);
377 (void)fputs("\n\n", stderr);
382 * use gzip. Non standard option.
384 gzip_program = GZIP_CMD;
388 * non-standard option on number of bytes written on a
389 * single archive volume.
391 if ((wrlimit = str_offt(optarg)) <= 0) {
392 paxwarn(1, "Invalid write limit %s", optarg);
395 if (wrlimit % BLKMULT) {
396 paxwarn(1, "Write limit is not a %d byte multiple",
404 * On extraction check file inode change time before the
405 * modification of the file name. Non standard option.
412 * non-standard limit on read faults
413 * 0 indicates stop after first error, values
414 * indicate a limit, "NONE" try forever
417 if (strcmp(NONE, optarg) == 0)
419 else if ((maxflt = atoi(optarg)) < 0) {
420 paxwarn(1, "Error count value must be positive");
426 * non-standard option for selecting files within an
427 * archive by group (gid or name)
429 if (grp_add(optarg) < 0) {
437 * follow command line symlinks only
451 * do NOT follow symlinks (default)
458 * non-standard option for selecting files within an
459 * archive by modification time range (lower,upper)
461 if (trng_add(optarg) < 0) {
469 * non-standard option for selecting files within an
470 * archive by user (uid or name)
472 if (usr_add(optarg) < 0) {
480 * do not pass over mount points in the file system
487 * On extraction check file inode change time after the
488 * modification of the file name. Non standard option.
495 * On extraction check modification time after the
496 * modification of the file name. Non standard option.
508 * figure out the operation mode of pax read,write,extract,copy,append
509 * or list. check that we have not been given a bogus set of flags
510 * for the operation mode.
516 } else if (ISEXTRACT(flg)) {
519 } else if (ISARCHIVE(flg)) {
522 } else if (ISAPPND(flg)) {
525 } else if (ISCOPY(flg)) {
536 * if we are writing (ARCHIVE) we use the default format if the user
537 * did not specify a format. when we write during an APPEND, we will
538 * adopt the format of the existing archive if none was supplied.
540 if (!(flg & XF) && (act == ARCHIVE))
541 frmt = &(fsub[DEFLT]);
544 * process the args as they are interpreted by the operation mode
549 for (; optind < argc; optind++)
550 if (pat_add(argv[optind], NULL) < 0)
554 if (optind >= argc) {
555 paxwarn(0, "Destination directory was not supplied");
563 for (; optind < argc; optind++)
564 if (ftree_add(argv[optind], 0) < 0)
567 * no read errors allowed on updates/append operation!
577 * look at the user specified flags. set globals as required and check if
578 * the user specified a legal set of flags. If not, complain and exit
582 tar_options(int argc, char **argv)
588 int incfiles_max = 0;
593 struct incfile *incfiles = NULL;
596 * Set default values.
601 * process option flags
603 while ((c = getoldopt(argc, argv,
604 "b:cef:hjmopqruts:vwxyzBC:HI:LOPXZ014578")) != -1) {
608 * specify blocksize in 512-byte blocks
610 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
611 paxwarn(1, "Invalid block size %s", optarg);
614 wrblksz *= 512; /* XXX - check for int oflow */
624 * stop after first error
630 * filename where the archive is stored
632 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
652 * use bzip2. Non standard option.
654 gzip_program = BZIP2_CMD;
658 * do not preserve modification time
663 if (opt_add("write_opt=nodir") < 0)
670 * preserve uid/gid and file mode, regardless of umask
677 * select first match for a pattern only
684 * append to the archive
690 * file name substitution name pattern
692 if (rep_add(optarg) < 0) {
699 * list contents of the tape
705 * verbose operation mode
711 * interactive file rename
717 * extract an archive, preserving mode,
718 * and mtime if possible.
725 * use gzip. Non standard option.
727 gzip_program = GZIP_CMD;
731 * Nothing to do here, this is pax default
739 * follow command line symlinks only
744 if (++nincfiles > incfiles_max) {
745 incfiles_max = nincfiles + 3;
746 incfiles = realloc(incfiles,
747 sizeof(*incfiles) * incfiles_max);
748 if (incfiles == NULL) {
749 paxwarn(0, "Unable to allocate space "
754 incfiles[nincfiles - 1].file = optarg;
755 incfiles[nincfiles - 1].dir = chdname;
765 * do not remove leading '/' from pathnames
771 * do not pass over mount points in the file system
779 gzip_program = COMPRESS_CMD;
807 /* Traditional tar behaviour (pax uses stderr unless in list mode) */
808 if (fstdin == 1 && act == ARCHIVE)
813 /* Traditional tar behaviour (pax wants to read file list from stdin) */
814 if ((act == ARCHIVE || act == APPND) && argc == 0 && nincfiles == 0)
818 * if we are writing (ARCHIVE) specify tar, otherwise run like pax
819 * (unless -o specified)
821 if (act == ARCHIVE || act == APPND)
822 frmt = &(fsub[Oflag ? F_OTAR : F_TAR]);
824 paxwarn(1, "The -O/-o options are only valid when writing an archive");
825 tar_usage(); /* only valid when writing */
829 * process the args as they are interpreted by the operation mode
837 char *file, *dir = NULL;
839 while (nincfiles || *argv != NULL) {
841 * If we queued up any include files,
842 * pull them in now. Otherwise, check
843 * for -I and -C positional flags.
844 * Anything else must be a file to
848 file = incfiles->file;
852 } else if (strcmp(*argv, "-I") == 0) {
863 if (strcmp(file, "-") == 0)
865 else if ((fp = fopen(file, "r")) == NULL) {
866 paxwarn(1, "Unable to open file '%s' for read", file);
869 while ((str = getline(fp)) != NULL) {
870 if (pat_add(str, dir) < 0)
874 if (strcmp(file, "-") != 0)
877 paxwarn(1, "Problem with file '%s'", file);
880 } else if (strcmp(*argv, "-C") == 0) {
884 } else if (pat_add(*argv++, chdname) < 0)
890 * if patterns were added, we are doing chdir()
891 * on a file-by-file basis, else, just one
892 * global chdir (if any) after opening input.
900 if (chdname != NULL) { /* initial chdir() */
901 if (ftree_add(chdname, 1) < 0)
905 while (nincfiles || *argv != NULL) {
906 char *file, *dir = NULL;
909 * If we queued up any include files, pull them in
910 * now. Otherwise, check for -I and -C positional
911 * flags. Anything else must be a file to include
915 file = incfiles->file;
919 } else if (strcmp(*argv, "-I") == 0) {
930 /* Set directory if needed */
932 if (ftree_add(dir, 1) < 0)
936 if (strcmp(file, "-") == 0)
938 else if ((fp = fopen(file, "r")) == NULL) {
939 paxwarn(1, "Unable to open file '%s' for read", file);
942 while ((str = getline(fp)) != NULL) {
943 if (ftree_add(str, 0) < 0)
946 if (strcmp(file, "-") != 0)
949 paxwarn(1, "Problem with file '%s'",
953 } else if (strcmp(*argv, "-C") == 0) {
956 if (ftree_add(*argv++, 1) < 0)
958 } else if (ftree_add(*argv++, 0) < 0)
962 * no read errors allowed on updates/append operation!
967 if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
968 arcname = getenv("TAPE");
969 if ((arcname == NULL) || (*arcname == '\0'))
970 arcname = _PATH_DEFTAPE;
984 slash += strspn(slash, "/");
985 slash += strcspn(slash, "/");
987 done = (*slash == '\0');
990 if (stat(path, &sb)) {
991 if (errno != ENOENT || mkdir(path, 0777)) {
992 paxwarn(1, "%s", path);
995 } else if (!S_ISDIR(sb.st_mode)) {
996 syswarn(1, ENOTDIR, "%s", path);
1008 * look at the user specified flags. set globals as required and check if
1009 * the user specified a legal set of flags. If not, complain and exit
1013 cpio_options(int argc, char **argv)
1029 while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
1033 * preserve access time on files read
1039 * swap bytes and half-words when reading data
1046 frmt = &(fsub[F_ACPIO]);
1050 * create directories as needed
1056 * invert meaning of pattern list
1062 * restore an archive
1070 * use links instead of copies when possible
1076 * preserve modification time
1085 frmt = &(fsub[F_CPIO]);
1095 * interactively rename files
1101 * swap bytes after reading data
1106 * list contents of archive
1113 * replace newer files
1119 * verbose operation mode
1125 * use gzip. Non standard option.
1127 gzip_program = GZIP_CMD;
1137 * Use 5120 byte block size
1143 * set block size in bytes
1145 wrblksz = atoi(optarg);
1149 * file with patterns to extract or list
1151 if ((fp = fopen(optarg, "r")) == NULL) {
1152 paxwarn(1, "Unable to open file '%s' for read", optarg);
1155 while ((str = getline(fp)) != NULL) {
1159 if (getline_error) {
1160 paxwarn(1, "Problem with file '%s'", optarg);
1168 * filename where the archive is stored
1170 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
1172 * treat a - as stdin
1181 * specify an archive format on write
1184 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
1185 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL)
1187 paxwarn(1, "Unknown -H format: %s", optarg);
1188 (void)fputs("cpio: Known -H formats are:", stderr);
1189 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
1190 (void)fprintf(stderr, " %s", fsub[i].name);
1191 (void)fputs("\n\n", stderr);
1196 * follow symbolic links
1202 * swap halfwords after reading data
1207 * use compress. Non standard option.
1209 gzip_program = COMPRESS_CMD;
1213 * process Version 6 cpio format
1215 frmt = &(fsub[F_OCPIO]);
1226 * process the args as they are interpreted by the operation mode
1231 while (*argv != NULL)
1232 if (pat_add(*argv++, NULL) < 0)
1236 if (*argv == NULL) {
1237 paxwarn(0, "Destination directory was not supplied");
1241 if (mkpath(dirptr) < 0)
1251 * no read errors allowed on updates/append operation!
1254 while ((str = getline(stdin)) != NULL) {
1257 if (getline_error) {
1258 paxwarn(1, "Problem while reading stdin");
1270 * print out those invalid flag sets found to the user
1274 printflg(unsigned int flg)
1279 (void)fprintf(stderr,"%s: Invalid combination of options:", argv0);
1280 while ((nxt = ffs(flg)) != 0) {
1283 (void)fprintf(stderr, " -%c", flgch[pos-1]);
1285 (void)putc('\n', stderr);
1290 * comparison routine used by bsearch to find the format specified
1295 c_frmt(const void *a, const void *b)
1297 return(strcmp(((const FSUB *)a)->name, ((const FSUB *)b)->name));
1302 * called by format specific options routines to get each format specific
1303 * flag and value specified with -o
1305 * pointer to next OPLIST entry or NULL (end of list).
1313 if ((opt = ophead) != NULL)
1314 ophead = ophead->fow;
1320 * generic routine used to complain about a format specific options
1321 * when the format does not support options.
1332 * print all we were given
1334 paxwarn(1,"These format options are not supported");
1335 while ((opt = opt_next()) != NULL)
1336 (void)fprintf(stderr, "\t%s = %s\n", opt->name, opt->value);
1343 * breaks the value supplied to -o into an option name and value. Options
1344 * are given to -o in the form -o name-value,name=value
1345 * multiple -o may be specified.
1347 * 0 if format in name=value format, -1 if -o is passed junk.
1351 opt_add(const char *str)
1359 if ((str == NULL) || (*str == '\0')) {
1360 paxwarn(0, "Invalid option name");
1363 if ((lstr = strdup(str)) == NULL) {
1364 paxwarn(0, "Unable to allocate space for option list");
1367 frpt = endpt = lstr;
1370 * break into name and values pieces and stuff each one into a
1371 * OPLIST structure. When we know the format, the format specific
1372 * option function will go through this list
1374 while ((frpt != NULL) && (*frpt != '\0')) {
1375 if ((endpt = strchr(frpt, ',')) != NULL)
1377 if ((pt = strchr(frpt, '=')) == NULL) {
1378 paxwarn(0, "Invalid options format");
1382 if ((opt = (OPLIST *)malloc(sizeof(OPLIST))) == NULL) {
1383 paxwarn(0, "Unable to allocate space for option list");
1395 if (ophead == NULL) {
1396 optail = ophead = opt;
1407 * Convert an expression of the following forms to an off_t > 0.
1408 * 1) A positive decimal number.
1409 * 2) A positive decimal number followed by a b (mult by 512).
1410 * 3) A positive decimal number followed by a k (mult by 1024).
1411 * 4) A positive decimal number followed by a m (mult by 512).
1412 * 5) A positive decimal number followed by a w (mult by sizeof int)
1413 * 6) Two or more positive decimal numbers (with/without k,b or w).
1414 * separated by x (also * for backwards compatibility), specifying
1415 * the product of the indicated values.
1417 * 0 for an error, a positive value o.w.
1427 num = strtol(val, &expr, 0);
1428 if ((num == LONG_MAX) || (num <= 0) || (expr == val))
1430 num = strtoq(val, &expr, 0);
1431 if ((num == QUAD_MAX) || (num <= 0) || (expr == val))
1472 num *= str_offt(expr + 1);
1488 name = fgetln(f, &len);
1490 getline_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0;
1493 if (name[len-1] != '\n')
1497 getline_error = GETLINE_OUT_OF_MEM;
1500 memcpy(temp, name, len-1);
1507 * for those option functions where the archive format has nothing to do.
1520 * print the usage summary to the user
1526 (void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr);
1527 (void)fputs("[-s replstr] ... [-U user] ...", stderr);
1528 (void)fputs("\n [-G group] ... ", stderr);
1529 (void)fputs("[-T [from_date][,to_date]] ... ", stderr);
1530 (void)fputs("[pattern ...]\n", stderr);
1531 (void)fputs(" pax -r [-cdiknuvzDYZ] [-E limit] ", stderr);
1532 (void)fputs("[-f archive] [-o options] ... \n", stderr);
1533 (void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
1534 (void)fputs("[-U user] ... [-G group] ...\n ", stderr);
1535 (void)fputs("[-T [from_date][,to_date]] ... ", stderr);
1536 (void)fputs(" [pattern ...]\n", stderr);
1537 (void)fputs(" pax -w [-dituvzHLPX] [-b blocksize] ", stderr);
1538 (void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
1539 (void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
1540 (void)fputs("[-o options] ... [-U user] ...", stderr);
1541 (void)fputs("\n [-G group] ... ", stderr);
1542 (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1543 (void)fputs("[file ...]\n", stderr);
1544 (void)fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr);
1545 (void)fputs("[-p string] ... [-s replstr] ...", stderr);
1546 (void)fputs("\n [-U user] ... [-G group] ... ", stderr);
1547 (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1548 (void)fputs("\n [file ...] directory\n", stderr);
1554 * print the usage summary to the user
1560 (void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
1562 (void)fputs("[archive] [replstr] [-C directory] [-I file] [file ...]\n",
1569 * print the usage summary to the user
1575 (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
1576 (void)fputs(" [-F archive] < name-list [> archive]\n", stderr);
1577 (void)fputs(" cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);
1578 (void)fputs(" [-I archive] [-F archive] [pattern...] [< archive]\n", stderr);
1579 (void)fputs(" cpio -p [-adlLmuvV] destination-directory < name-list\n", stderr);