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;
86 #define GZIP_CMD "gzip" /* command to run as gzip */
87 #define COMPRESS_CMD "compress" /* command to run as compress */
88 #define BZIP2_CMD "bzip2" /* command to run as gzip */
91 * Format specific routine table - MUST BE IN SORTED ORDER BY NAME
92 * (see pax.h for description of each function)
94 * name, blksz, hdsz, udev, hlk, blkagn, inhead, id, st_read,
95 * read, end_read, st_write, write, end_write, trail,
96 * rd_data, wr_data, options
100 /* 0: OLD BINARY CPIO */
101 {"bcpio", 5120, sizeof(HD_BCPIO), 1, 0, 0, 1, bcpio_id, cpio_strd,
102 bcpio_rd, bcpio_endrd, cpio_stwr, bcpio_wr, cpio_endwr, cpio_trail,
103 NULL, rd_wrfile, wr_rdfile, bad_opt},
105 /* 1: OLD OCTAL CHARACTER CPIO */
106 {"cpio", 5120, sizeof(HD_CPIO), 1, 0, 0, 1, cpio_id, cpio_strd,
107 cpio_rd, cpio_endrd, cpio_stwr, cpio_wr, cpio_endwr, cpio_trail,
108 NULL, rd_wrfile, wr_rdfile, bad_opt},
110 /* 2: SVR4 HEX CPIO */
111 {"sv4cpio", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, vcpio_id, cpio_strd,
112 vcpio_rd, vcpio_endrd, cpio_stwr, vcpio_wr, cpio_endwr, cpio_trail,
113 NULL, rd_wrfile, wr_rdfile, bad_opt},
115 /* 3: SVR4 HEX CPIO WITH CRC */
116 {"sv4crc", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, crc_id, crc_strd,
117 vcpio_rd, vcpio_endrd, crc_stwr, vcpio_wr, cpio_endwr, cpio_trail,
118 NULL, rd_wrfile, wr_rdfile, bad_opt},
121 {"tar", 10240, BLKMULT, 0, 1, BLKMULT, 0, tar_id, no_op,
122 tar_rd, tar_endrd, no_op, tar_wr, tar_endwr, NULL, tar_trail,
123 rd_wrfile, wr_rdfile, tar_opt},
126 {"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
127 ustar_rd, tar_endrd, ustar_stwr, ustar_wr, tar_endwr, NULL, tar_trail,
128 rd_wrfile, wr_rdfile, bad_opt},
130 #define F_OCPIO 0 /* format when called as cpio -6 */
131 #define F_ACPIO 1 /* format when called as cpio -c */
132 #define F_CPIO 3 /* format when called as cpio */
133 #define F_OTAR 4 /* format when called as tar -o */
134 #define F_TAR 5 /* format when called as tar */
135 #define DEFLT 5 /* default write format from list above */
138 * ford is the archive search order used by get_arc() to determine what kind
139 * of archive we are dealing with. This helps to properly id archive formats
140 * some formats may be subsets of others....
142 int ford[] = {5, 4, 3, 2, 1, 0, -1 };
146 * figure out if we are pax, tar or cpio. Call the appropriate options
151 options(int argc, char **argv)
155 * Are we acting like pax, tar or cpio (based on argv[0])
157 if ((argv0 = strrchr(argv[0], '/')) != NULL)
162 if (strcmp(NM_TAR, argv0) == 0) {
163 tar_options(argc, argv);
166 else if (strcmp(NM_CPIO, argv0) == 0) {
167 cpio_options(argc, argv);
171 * assume pax as the default
174 pax_options(argc, argv);
180 * look at the user specified flags. set globals as required and check if
181 * the user specified a legal set of flags. If not, complain and exit
185 pax_options(int argc, char **argv)
189 unsigned int flg = 0;
190 unsigned int bflg = 0;
195 * process option flags
197 while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ"))
211 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
212 paxwarn(1, "Invalid block size %s", optarg);
218 * inverse match on patterns
225 * match only dir on extract, not the subtree at dir
232 * filename where the archive is stored
239 * interactive file rename
246 * do not clobber files that exist
253 * try to link src to dest with copy (-rw)
260 * select first match for a pattern only
267 * pass format specific options
270 if (opt_add(optarg) < 0)
275 * specify file characteristic options
277 for (pt = optarg; *pt != '\0'; ++pt) {
281 * do not preserve access time
287 * preserve user id, group id, file
288 * mode, access/modification times
297 * do not preserve modification time
309 * preserver file mode bits
314 paxwarn(1, "Invalid -p string: %c", *pt);
329 * file name substitution name pattern
331 if (rep_add(optarg) < 0) {
339 * preserve access time on file system nodes we read
346 * ignore those older files
353 * verbose operation mode
366 * specify an archive format on write
369 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
370 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL) {
374 paxwarn(1, "Unknown -x format: %s", optarg);
375 (void)fputs("pax: Known -x formats are:", stderr);
376 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
377 (void)fprintf(stderr, " %s", fsub[i].name);
378 (void)fputs("\n\n", stderr);
383 * use gzip. Non standard option.
385 gzip_program = GZIP_CMD;
389 * non-standard option on number of bytes written on a
390 * single archive volume.
392 if ((wrlimit = str_offt(optarg)) <= 0) {
393 paxwarn(1, "Invalid write limit %s", optarg);
396 if (wrlimit % BLKMULT) {
397 paxwarn(1, "Write limit is not a %d byte multiple",
405 * On extraction check file inode change time before the
406 * modification of the file name. Non standard option.
413 * non-standard limit on read faults
414 * 0 indicates stop after first error, values
415 * indicate a limit, "NONE" try forever
418 if (strcmp(NONE, optarg) == 0)
420 else if ((maxflt = atoi(optarg)) < 0) {
421 paxwarn(1, "Error count value must be positive");
427 * non-standard option for selecting files within an
428 * archive by group (gid or name)
430 if (grp_add(optarg) < 0) {
438 * follow command line symlinks only
452 * Force one volume. Non standard option.
458 * do NOT follow symlinks (default)
465 * non-standard option for selecting files within an
466 * archive by modification time range (lower,upper)
468 if (trng_add(optarg) < 0) {
476 * non-standard option for selecting files within an
477 * archive by user (uid or name)
479 if (usr_add(optarg) < 0) {
487 * do not pass over mount points in the file system
494 * On extraction check file inode change time after the
495 * modification of the file name. Non standard option.
502 * On extraction check modification time after the
503 * modification of the file name. Non standard option.
515 * figure out the operation mode of pax read,write,extract,copy,append
516 * or list. check that we have not been given a bogus set of flags
517 * for the operation mode.
523 } else if (ISEXTRACT(flg)) {
526 } else if (ISARCHIVE(flg)) {
529 } else if (ISAPPND(flg)) {
532 } else if (ISCOPY(flg)) {
543 * if we are writing (ARCHIVE) we use the default format if the user
544 * did not specify a format. when we write during an APPEND, we will
545 * adopt the format of the existing archive if none was supplied.
547 if (!(flg & XF) && (act == ARCHIVE))
548 frmt = &(fsub[DEFLT]);
551 * process the args as they are interpreted by the operation mode
556 for (; optind < argc; optind++)
557 if (pat_add(argv[optind], NULL) < 0)
561 if (optind >= argc) {
562 paxwarn(0, "Destination directory was not supplied");
570 for (; optind < argc; optind++)
571 if (ftree_add(argv[optind], 0) < 0)
574 * no read errors allowed on updates/append operation!
584 * look at the user specified flags. set globals as required and check if
585 * the user specified a legal set of flags. If not, complain and exit
589 tar_options(int argc, char **argv)
595 int incfiles_max = 0;
600 struct incfile *incfiles = NULL;
603 * Set default values.
608 * process option flags
610 while ((c = getoldopt(argc, argv,
611 "b:cef:hjmopqruts:vwxyzBC:HI:LOPXZ014578")) != -1) {
615 * specify blocksize in 512-byte blocks
617 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
618 paxwarn(1, "Invalid block size %s", optarg);
621 wrblksz *= 512; /* XXX - check for int oflow */
631 * stop after first error
637 * filename where the archive is stored
639 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
659 * use bzip2. Non standard option.
661 gzip_program = BZIP2_CMD;
665 * do not preserve modification time
670 if (opt_add("write_opt=nodir") < 0)
677 * preserve uid/gid and file mode, regardless of umask
684 * select first match for a pattern only
691 * append to the archive
697 * file name substitution name pattern
699 if (rep_add(optarg) < 0) {
706 * list contents of the tape
712 * verbose operation mode
718 * interactive file rename
724 * extract an archive, preserving mode,
725 * and mtime if possible.
732 * use gzip. Non standard option.
734 gzip_program = GZIP_CMD;
738 * Nothing to do here, this is pax default
746 * follow command line symlinks only
751 if (++nincfiles > incfiles_max) {
752 incfiles_max = nincfiles + 3;
753 incfiles = realloc(incfiles,
754 sizeof(*incfiles) * incfiles_max);
755 if (incfiles == NULL) {
756 paxwarn(0, "Unable to allocate space "
761 incfiles[nincfiles - 1].file = optarg;
762 incfiles[nincfiles - 1].dir = chdname;
772 * do not remove leading '/' from pathnames
778 * do not pass over mount points in the file system
786 gzip_program = COMPRESS_CMD;
814 /* Traditional tar behaviour (pax uses stderr unless in list mode) */
815 if (fstdin == 1 && act == ARCHIVE)
820 /* Traditional tar behaviour (pax wants to read file list from stdin) */
821 if ((act == ARCHIVE || act == APPND) && argc == 0 && nincfiles == 0)
825 * if we are writing (ARCHIVE) specify tar, otherwise run like pax
826 * (unless -o specified)
828 if (act == ARCHIVE || act == APPND)
829 frmt = &(fsub[tar_Oflag ? F_OTAR : F_TAR]);
830 else if (tar_Oflag) {
831 paxwarn(1, "The -O/-o options are only valid when writing an archive");
832 tar_usage(); /* only valid when writing */
836 * process the args as they are interpreted by the operation mode
844 char *file, *dir = NULL;
846 while (nincfiles || *argv != NULL) {
848 * If we queued up any include files,
849 * pull them in now. Otherwise, check
850 * for -I and -C positional flags.
851 * Anything else must be a file to
855 file = incfiles->file;
859 } else if (strcmp(*argv, "-I") == 0) {
870 if (strcmp(file, "-") == 0)
872 else if ((fp = fopen(file, "r")) == NULL) {
873 paxwarn(1, "Unable to open file '%s' for read", file);
876 while ((str = getline(fp)) != NULL) {
877 if (pat_add(str, dir) < 0)
881 if (strcmp(file, "-") != 0)
884 paxwarn(1, "Problem with file '%s'", file);
887 } else if (strcmp(*argv, "-C") == 0) {
891 } else if (pat_add(*argv++, chdname) < 0)
897 * if patterns were added, we are doing chdir()
898 * on a file-by-file basis, else, just one
899 * global chdir (if any) after opening input.
907 if (chdname != NULL) { /* initial chdir() */
908 if (ftree_add(chdname, 1) < 0)
912 while (nincfiles || *argv != NULL) {
913 char *file, *dir = NULL;
916 * If we queued up any include files, pull them in
917 * now. Otherwise, check for -I and -C positional
918 * flags. Anything else must be a file to include
922 file = incfiles->file;
926 } else if (strcmp(*argv, "-I") == 0) {
937 /* Set directory if needed */
939 if (ftree_add(dir, 1) < 0)
943 if (strcmp(file, "-") == 0)
945 else if ((fp = fopen(file, "r")) == NULL) {
946 paxwarn(1, "Unable to open file '%s' for read", file);
949 while ((str = getline(fp)) != NULL) {
950 if (ftree_add(str, 0) < 0)
953 if (strcmp(file, "-") != 0)
956 paxwarn(1, "Problem with file '%s'",
960 } else if (strcmp(*argv, "-C") == 0) {
963 if (ftree_add(*argv++, 1) < 0)
965 } else if (ftree_add(*argv++, 0) < 0)
969 * no read errors allowed on updates/append operation!
974 if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
975 arcname = getenv("TAPE");
976 if ((arcname == NULL) || (*arcname == '\0'))
977 arcname = _PATH_DEFTAPE;
991 slash += strspn(slash, "/");
992 slash += strcspn(slash, "/");
994 done = (*slash == '\0');
997 if (stat(path, &sb)) {
998 if (errno != ENOENT || mkdir(path, 0777)) {
999 paxwarn(1, "%s", path);
1002 } else if (!S_ISDIR(sb.st_mode)) {
1003 syswarn(1, ENOTDIR, "%s", path);
1015 * look at the user specified flags. set globals as required and check if
1016 * the user specified a legal set of flags. If not, complain and exit
1020 cpio_options(int argc, char **argv)
1036 while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
1040 * preserve access time on files read
1046 * swap bytes and half-words when reading data
1053 frmt = &(fsub[F_ACPIO]);
1057 * create directories as needed
1063 * invert meaning of pattern list
1069 * restore an archive
1077 * use links instead of copies when possible
1083 * preserve modification time
1092 frmt = &(fsub[F_CPIO]);
1102 * interactively rename files
1108 * swap bytes after reading data
1113 * list contents of archive
1120 * replace newer files
1126 * verbose operation mode
1132 * use gzip. Non standard option.
1134 gzip_program = GZIP_CMD;
1144 * Use 5120 byte block size
1150 * set block size in bytes
1152 wrblksz = atoi(optarg);
1156 * file with patterns to extract or list
1158 if ((fp = fopen(optarg, "r")) == NULL) {
1159 paxwarn(1, "Unable to open file '%s' for read", optarg);
1162 while ((str = getline(fp)) != NULL) {
1166 if (getline_error) {
1167 paxwarn(1, "Problem with file '%s'", optarg);
1175 * filename where the archive is stored
1177 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
1179 * treat a - as stdin
1188 * specify an archive format on write
1191 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
1192 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL)
1194 paxwarn(1, "Unknown -H format: %s", optarg);
1195 (void)fputs("cpio: Known -H formats are:", stderr);
1196 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
1197 (void)fprintf(stderr, " %s", fsub[i].name);
1198 (void)fputs("\n\n", stderr);
1203 * follow symbolic links
1209 * swap halfwords after reading data
1214 * use compress. Non standard option.
1216 gzip_program = COMPRESS_CMD;
1220 * process Version 6 cpio format
1222 frmt = &(fsub[F_OCPIO]);
1233 * process the args as they are interpreted by the operation mode
1238 while (*argv != NULL)
1239 if (pat_add(*argv++, NULL) < 0)
1243 if (*argv == NULL) {
1244 paxwarn(0, "Destination directory was not supplied");
1248 if (mkpath(dirptr) < 0)
1258 * no read errors allowed on updates/append operation!
1261 while ((str = getline(stdin)) != NULL) {
1264 if (getline_error) {
1265 paxwarn(1, "Problem while reading stdin");
1277 * print out those invalid flag sets found to the user
1281 printflg(unsigned int flg)
1286 (void)fprintf(stderr,"%s: Invalid combination of options:", argv0);
1287 while ((nxt = ffs(flg)) != 0) {
1290 (void)fprintf(stderr, " -%c", flgch[pos-1]);
1292 (void)putc('\n', stderr);
1297 * comparison routine used by bsearch to find the format specified
1302 c_frmt(const void *a, const void *b)
1304 return(strcmp(((const FSUB *)a)->name, ((const FSUB *)b)->name));
1309 * called by format specific options routines to get each format specific
1310 * flag and value specified with -o
1312 * pointer to next OPLIST entry or NULL (end of list).
1320 if ((opt = ophead) != NULL)
1321 ophead = ophead->fow;
1327 * generic routine used to complain about a format specific options
1328 * when the format does not support options.
1339 * print all we were given
1341 paxwarn(1,"These format options are not supported");
1342 while ((opt = opt_next()) != NULL)
1343 (void)fprintf(stderr, "\t%s = %s\n", opt->name, opt->value);
1350 * breaks the value supplied to -o into an option name and value. Options
1351 * are given to -o in the form -o name-value,name=value
1352 * multiple -o may be specified.
1354 * 0 if format in name=value format, -1 if -o is passed junk.
1358 opt_add(const char *str)
1366 if ((str == NULL) || (*str == '\0')) {
1367 paxwarn(0, "Invalid option name");
1370 if ((lstr = strdup(str)) == NULL) {
1371 paxwarn(0, "Unable to allocate space for option list");
1374 frpt = endpt = lstr;
1377 * break into name and values pieces and stuff each one into a
1378 * OPLIST structure. When we know the format, the format specific
1379 * option function will go through this list
1381 while ((frpt != NULL) && (*frpt != '\0')) {
1382 if ((endpt = strchr(frpt, ',')) != NULL)
1384 if ((pt = strchr(frpt, '=')) == NULL) {
1385 paxwarn(0, "Invalid options format");
1389 if ((opt = (OPLIST *)malloc(sizeof(OPLIST))) == NULL) {
1390 paxwarn(0, "Unable to allocate space for option list");
1402 if (ophead == NULL) {
1403 optail = ophead = opt;
1414 * Convert an expression of the following forms to an off_t > 0.
1415 * 1) A positive decimal number.
1416 * 2) A positive decimal number followed by a b (mult by 512).
1417 * 3) A positive decimal number followed by a k (mult by 1024).
1418 * 4) A positive decimal number followed by a m (mult by 512).
1419 * 5) A positive decimal number followed by a w (mult by sizeof int)
1420 * 6) Two or more positive decimal numbers (with/without k,b or w).
1421 * separated by x (also * for backwards compatibility), specifying
1422 * the product of the indicated values.
1424 * 0 for an error, a positive value o.w.
1434 num = strtol(val, &expr, 0);
1435 if ((num == LONG_MAX) || (num <= 0) || (expr == val))
1437 num = strtoq(val, &expr, 0);
1438 if ((num == QUAD_MAX) || (num <= 0) || (expr == val))
1479 num *= str_offt(expr + 1);
1495 name = fgetln(f, &len);
1497 getline_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0;
1500 if (name[len-1] != '\n')
1504 getline_error = GETLINE_OUT_OF_MEM;
1507 memcpy(temp, name, len-1);
1514 * for those option functions where the archive format has nothing to do.
1527 * print the usage summary to the user
1533 (void)fputs("usage: pax [-cdnOvz] [-E limit] [-f archive] ", stderr);
1534 (void)fputs("[-s replstr] ... [-U user] ...", stderr);
1535 (void)fputs("\n [-G group] ... ", stderr);
1536 (void)fputs("[-T [from_date][,to_date]] ... ", stderr);
1537 (void)fputs("[pattern ...]\n", stderr);
1538 (void)fputs(" pax -r [-cdiknOuvzDYZ] [-E limit] ", stderr);
1539 (void)fputs("[-f archive] [-o options] ... \n", stderr);
1540 (void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
1541 (void)fputs("[-U user] ... [-G group] ...\n ", stderr);
1542 (void)fputs("[-T [from_date][,to_date]] ... ", stderr);
1543 (void)fputs(" [pattern ...]\n", stderr);
1544 (void)fputs(" pax -w [-dituvzHLOPX] [-b blocksize] ", stderr);
1545 (void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
1546 (void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
1547 (void)fputs("[-o options] ... [-U user] ...", stderr);
1548 (void)fputs("\n [-G group] ... ", stderr);
1549 (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1550 (void)fputs("[file ...]\n", stderr);
1551 (void)fputs(" pax -r -w [-diklntuvDHLOPXYZ] ", stderr);
1552 (void)fputs("[-p string] ... [-s replstr] ...", stderr);
1553 (void)fputs("\n [-U user] ... [-G group] ... ", stderr);
1554 (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1555 (void)fputs("\n [file ...] directory\n", stderr);
1561 * print the usage summary to the user
1567 (void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
1569 (void)fputs("[archive] [replstr] [-C directory] [-I file] [file ...]\n",
1576 * print the usage summary to the user
1582 (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
1583 (void)fputs(" [-F archive] < name-list [> archive]\n", stderr);
1584 (void)fputs(" cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);
1585 (void)fputs(" [-I archive] [-F archive] [pattern...] [< archive]\n", stderr);
1586 (void)fputs(" cpio -p [-adlLmuvV] destination-directory < name-list\n", stderr);