2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1992 Keith Muller.
5 * Copyright (c) 1992, 1993
6 * The Regents of the University of California. All rights reserved.
8 * This code is derived from software contributed to Berkeley by
9 * Keith Muller of the University of California, San Diego.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
42 #include <sys/cdefs.h>
43 __FBSDID("$FreeBSD$");
45 #include <sys/types.h>
62 * Routines which handle command line options
65 static char flgch[] = FLGCH; /* list of all possible flags */
66 static OPLIST *ophead = NULL; /* head for format specific options -x */
67 static OPLIST *optail = NULL; /* option tail */
69 static int no_op(void);
70 static void printflg(unsigned int);
71 static int c_frmt(const void *, const void *);
72 static off_t str_offt(char *);
73 static char *get_line(FILE *fp);
74 static void pax_options(int, char **);
75 static void pax_usage(void);
76 static void tar_options(int, char **);
77 static void tar_usage(void);
78 static void cpio_options(int, char **);
79 static void cpio_usage(void);
81 /* errors from get_line */
82 #define GETLINE_FILE_CORRUPT 1
83 #define GETLINE_OUT_OF_MEM 2
84 static int get_line_error;
88 #define GZIP_CMD "gzip" /* command to run as gzip */
89 #define COMPRESS_CMD "compress" /* command to run as compress */
90 #define BZIP2_CMD "bzip2" /* command to run as gzip */
93 * Format specific routine table - MUST BE IN SORTED ORDER BY NAME
94 * (see pax.h for description of each function)
96 * name, blksz, hdsz, udev, hlk, blkagn, inhead, id, st_read,
97 * read, end_read, st_write, write, end_write, trail,
98 * rd_data, wr_data, options
102 /* 0: OLD BINARY CPIO */
103 {"bcpio", 5120, sizeof(HD_BCPIO), 1, 0, 0, 1, bcpio_id, cpio_strd,
104 bcpio_rd, bcpio_endrd, cpio_stwr, bcpio_wr, cpio_endwr, cpio_trail,
105 NULL, rd_wrfile, wr_rdfile, bad_opt},
107 /* 1: OLD OCTAL CHARACTER CPIO */
108 {"cpio", 5120, sizeof(HD_CPIO), 1, 0, 0, 1, cpio_id, cpio_strd,
109 cpio_rd, cpio_endrd, cpio_stwr, cpio_wr, cpio_endwr, cpio_trail,
110 NULL, rd_wrfile, wr_rdfile, bad_opt},
112 /* 2: SVR4 HEX CPIO */
113 {"sv4cpio", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, vcpio_id, cpio_strd,
114 vcpio_rd, vcpio_endrd, cpio_stwr, vcpio_wr, cpio_endwr, cpio_trail,
115 NULL, rd_wrfile, wr_rdfile, bad_opt},
117 /* 3: SVR4 HEX CPIO WITH CRC */
118 {"sv4crc", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, crc_id, crc_strd,
119 vcpio_rd, vcpio_endrd, crc_stwr, vcpio_wr, cpio_endwr, cpio_trail,
120 NULL, rd_wrfile, wr_rdfile, bad_opt},
123 {"tar", 10240, BLKMULT, 0, 1, BLKMULT, 0, tar_id, no_op,
124 tar_rd, tar_endrd, no_op, tar_wr, tar_endwr, NULL, tar_trail,
125 rd_wrfile, wr_rdfile, tar_opt},
128 {"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
129 ustar_rd, tar_endrd, ustar_stwr, ustar_wr, tar_endwr, NULL, tar_trail,
130 rd_wrfile, wr_rdfile, bad_opt},
132 #define F_OCPIO 0 /* format when called as cpio -6 */
133 #define F_ACPIO 1 /* format when called as cpio -c */
134 #define F_CPIO 3 /* format when called as cpio */
135 #define F_OTAR 4 /* format when called as tar -o */
136 #define F_TAR 5 /* format when called as tar */
137 #define DEFLT 5 /* default write format from list above */
140 * ford is the archive search order used by get_arc() to determine what kind
141 * of archive we are dealing with. This helps to properly id archive formats
142 * some formats may be subsets of others....
144 int ford[] = {5, 4, 3, 2, 1, 0, -1 };
148 * figure out if we are pax, tar or cpio. Call the appropriate options
153 options(int argc, char **argv)
157 * Are we acting like pax, tar or cpio (based on argv[0])
159 if ((argv0 = strrchr(argv[0], '/')) != NULL)
164 if (strcmp(NM_TAR, argv0) == 0) {
165 tar_options(argc, argv);
168 else if (strcmp(NM_CPIO, argv0) == 0) {
169 cpio_options(argc, argv);
173 * assume pax as the default
176 pax_options(argc, argv);
182 * look at the user specified flags. set globals as required and check if
183 * the user specified a legal set of flags. If not, complain and exit
187 pax_options(int argc, char **argv)
191 unsigned int flg = 0;
192 unsigned int bflg = 0;
197 * process option flags
199 while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ"))
213 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
214 paxwarn(1, "Invalid block size %s", optarg);
220 * inverse match on patterns
227 * match only dir on extract, not the subtree at dir
234 * filename where the archive is stored
241 * interactive file rename
248 * do not clobber files that exist
255 * try to link src to dest with copy (-rw)
262 * select first match for a pattern only
269 * pass format specific options
272 if (opt_add(optarg) < 0)
277 * specify file characteristic options
279 for (pt = optarg; *pt != '\0'; ++pt) {
283 * do not preserve access time
289 * preserve user id, group id, file
290 * mode, access/modification times
299 * do not preserve modification time
311 * preserver file mode bits
316 paxwarn(1, "Invalid -p string: %c", *pt);
331 * file name substitution name pattern
333 if (rep_add(optarg) < 0) {
341 * preserve access time on file system nodes we read
348 * ignore those older files
355 * verbose operation mode
368 * specify an archive format on write
371 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
372 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL) {
376 paxwarn(1, "Unknown -x format: %s", optarg);
377 (void)fputs("pax: Known -x formats are:", stderr);
378 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
379 (void)fprintf(stderr, " %s", fsub[i].name);
380 (void)fputs("\n\n", stderr);
385 * use gzip. Non standard option.
387 gzip_program = GZIP_CMD;
391 * non-standard option on number of bytes written on a
392 * single archive volume.
394 if ((wrlimit = str_offt(optarg)) <= 0) {
395 paxwarn(1, "Invalid write limit %s", optarg);
398 if (wrlimit % BLKMULT) {
399 paxwarn(1, "Write limit is not a %d byte multiple",
407 * On extraction check file inode change time before the
408 * modification of the file name. Non standard option.
415 * non-standard limit on read faults
416 * 0 indicates stop after first error, values
417 * indicate a limit, "NONE" try forever
420 if (strcmp(NONE, optarg) == 0)
422 else if ((maxflt = atoi(optarg)) < 0) {
423 paxwarn(1, "Error count value must be positive");
429 * non-standard option for selecting files within an
430 * archive by group (gid or name)
432 if (grp_add(optarg) < 0) {
440 * follow command line symlinks only
454 * Force one volume. Non standard option.
460 * do NOT follow symlinks (default)
467 * non-standard option for selecting files within an
468 * archive by modification time range (lower,upper)
470 if (trng_add(optarg) < 0) {
478 * non-standard option for selecting files within an
479 * archive by user (uid or name)
481 if (usr_add(optarg) < 0) {
489 * do not pass over mount points in the file system
496 * On extraction check file inode change time after the
497 * modification of the file name. Non standard option.
504 * On extraction check modification time after the
505 * modification of the file name. Non standard option.
517 * figure out the operation mode of pax read,write,extract,copy,append
518 * or list. check that we have not been given a bogus set of flags
519 * for the operation mode.
525 } else if (ISEXTRACT(flg)) {
528 } else if (ISARCHIVE(flg)) {
531 } else if (ISAPPND(flg)) {
534 } else if (ISCOPY(flg)) {
545 * if we are writing (ARCHIVE) we use the default format if the user
546 * did not specify a format. when we write during an APPEND, we will
547 * adopt the format of the existing archive if none was supplied.
549 if (!(flg & XF) && (act == ARCHIVE))
550 frmt = &(fsub[DEFLT]);
553 * process the args as they are interpreted by the operation mode
558 for (; optind < argc; optind++)
559 if (pat_add(argv[optind], NULL) < 0)
563 if (optind >= argc) {
564 paxwarn(0, "Destination directory was not supplied");
572 for (; optind < argc; optind++)
573 if (ftree_add(argv[optind], 0) < 0)
576 * no read errors allowed on updates/append operation!
586 * look at the user specified flags. set globals as required and check if
587 * the user specified a legal set of flags. If not, complain and exit
591 tar_options(int argc, char **argv)
597 int incfiles_max = 0;
602 struct incfile *incfiles = NULL;
605 * Set default values.
610 * process option flags
612 while ((c = getoldopt(argc, argv,
613 "b:cef:hjmopqruts:vwxyzBC:HI:LOPXZ014578")) != -1) {
617 * specify blocksize in 512-byte blocks
619 if ((wrblksz = (int)str_offt(optarg)) <= 0) {
620 paxwarn(1, "Invalid block size %s", optarg);
623 wrblksz *= 512; /* XXX - check for int oflow */
633 * stop after first error
639 * filename where the archive is stored
641 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
661 * use bzip2. Non standard option.
663 gzip_program = BZIP2_CMD;
667 * do not preserve modification time
672 if (opt_add("write_opt=nodir") < 0)
679 * preserve uid/gid and file mode, regardless of umask
686 * select first match for a pattern only
693 * append to the archive
699 * file name substitution name pattern
701 if (rep_add(optarg) < 0) {
708 * list contents of the tape
714 * verbose operation mode
720 * interactive file rename
726 * extract an archive, preserving mode,
727 * and mtime if possible.
734 * use gzip. Non standard option.
736 gzip_program = GZIP_CMD;
740 * Nothing to do here, this is pax default
748 * follow command line symlinks only
753 if (++nincfiles > incfiles_max) {
754 incfiles_max = nincfiles + 3;
755 incfiles = realloc(incfiles,
756 sizeof(*incfiles) * incfiles_max);
757 if (incfiles == NULL) {
758 paxwarn(0, "Unable to allocate space "
763 incfiles[nincfiles - 1].file = optarg;
764 incfiles[nincfiles - 1].dir = chdname;
774 * do not remove leading '/' from pathnames
780 * do not pass over mount points in the file system
788 gzip_program = COMPRESS_CMD;
816 /* Traditional tar behaviour (pax uses stderr unless in list mode) */
817 if (fstdin == 1 && act == ARCHIVE)
822 /* Traditional tar behaviour (pax wants to read file list from stdin) */
823 if ((act == ARCHIVE || act == APPND) && argc == 0 && nincfiles == 0)
827 * if we are writing (ARCHIVE) specify tar, otherwise run like pax
828 * (unless -o specified)
830 if (act == ARCHIVE || act == APPND)
831 frmt = &(fsub[tar_Oflag ? F_OTAR : F_TAR]);
832 else if (tar_Oflag) {
833 paxwarn(1, "The -O/-o options are only valid when writing an archive");
834 tar_usage(); /* only valid when writing */
838 * process the args as they are interpreted by the operation mode
846 char *file, *dir = NULL;
848 while (nincfiles || *argv != NULL) {
850 * If we queued up any include files,
851 * pull them in now. Otherwise, check
852 * for -I and -C positional flags.
853 * Anything else must be a file to
857 file = incfiles->file;
861 } else if (strcmp(*argv, "-I") == 0) {
872 if (strcmp(file, "-") == 0)
874 else if ((fp = fopen(file, "r")) == NULL) {
875 paxwarn(1, "Unable to open file '%s' for read", file);
878 while ((str = get_line(fp)) != NULL) {
879 if (pat_add(str, dir) < 0)
883 if (strcmp(file, "-") != 0)
885 if (get_line_error) {
886 paxwarn(1, "Problem with file '%s'", file);
889 } else if (strcmp(*argv, "-C") == 0) {
893 } else if (pat_add(*argv++, chdname) < 0)
899 * if patterns were added, we are doing chdir()
900 * on a file-by-file basis, else, just one
901 * global chdir (if any) after opening input.
909 if (chdname != NULL) { /* initial chdir() */
910 if (ftree_add(chdname, 1) < 0)
914 while (nincfiles || *argv != NULL) {
915 char *file, *dir = NULL;
918 * If we queued up any include files, pull them in
919 * now. Otherwise, check for -I and -C positional
920 * flags. Anything else must be a file to include
924 file = incfiles->file;
928 } else if (strcmp(*argv, "-I") == 0) {
939 /* Set directory if needed */
941 if (ftree_add(dir, 1) < 0)
945 if (strcmp(file, "-") == 0)
947 else if ((fp = fopen(file, "r")) == NULL) {
948 paxwarn(1, "Unable to open file '%s' for read", file);
951 while ((str = get_line(fp)) != NULL) {
952 if (ftree_add(str, 0) < 0)
955 if (strcmp(file, "-") != 0)
957 if (get_line_error) {
958 paxwarn(1, "Problem with file '%s'",
962 } else if (strcmp(*argv, "-C") == 0) {
965 if (ftree_add(*argv++, 1) < 0)
967 } else if (ftree_add(*argv++, 0) < 0)
971 * no read errors allowed on updates/append operation!
976 if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
977 arcname = getenv("TAPE");
978 if ((arcname == NULL) || (*arcname == '\0'))
979 arcname = _PATH_DEFTAPE;
993 slash += strspn(slash, "/");
994 slash += strcspn(slash, "/");
996 done = (*slash == '\0');
999 if (stat(path, &sb)) {
1000 if (errno != ENOENT || mkdir(path, 0777)) {
1001 paxwarn(1, "%s", path);
1004 } else if (!S_ISDIR(sb.st_mode)) {
1005 syswarn(1, ENOTDIR, "%s", path);
1017 * look at the user specified flags. set globals as required and check if
1018 * the user specified a legal set of flags. If not, complain and exit
1022 cpio_options(int argc, char **argv)
1038 while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
1042 * preserve access time on files read
1048 * swap bytes and half-words when reading data
1055 frmt = &(fsub[F_ACPIO]);
1059 * create directories as needed
1065 * invert meaning of pattern list
1071 * restore an archive
1079 * use links instead of copies when possible
1085 * preserve modification time
1094 frmt = &(fsub[F_CPIO]);
1104 * interactively rename files
1110 * swap bytes after reading data
1115 * list contents of archive
1122 * replace newer files
1128 * verbose operation mode
1134 * use gzip. Non standard option.
1136 gzip_program = GZIP_CMD;
1146 * Use 5120 byte block size
1152 * set block size in bytes
1154 wrblksz = atoi(optarg);
1158 * file with patterns to extract or list
1160 if ((fp = fopen(optarg, "r")) == NULL) {
1161 paxwarn(1, "Unable to open file '%s' for read", optarg);
1164 while ((str = get_line(fp)) != NULL) {
1168 if (get_line_error) {
1169 paxwarn(1, "Problem with file '%s'", optarg);
1177 * filename where the archive is stored
1179 if ((optarg[0] == '-') && (optarg[1]== '\0')) {
1181 * treat a - as stdin
1190 * specify an archive format on write
1193 if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
1194 sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) != NULL)
1196 paxwarn(1, "Unknown -H format: %s", optarg);
1197 (void)fputs("cpio: Known -H formats are:", stderr);
1198 for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
1199 (void)fprintf(stderr, " %s", fsub[i].name);
1200 (void)fputs("\n\n", stderr);
1205 * follow symbolic links
1211 * swap halfwords after reading data
1216 * use compress. Non standard option.
1218 gzip_program = COMPRESS_CMD;
1222 * process Version 6 cpio format
1224 frmt = &(fsub[F_OCPIO]);
1235 * process the args as they are interpreted by the operation mode
1240 while (*argv != NULL)
1241 if (pat_add(*argv++, NULL) < 0)
1245 if (*argv == NULL) {
1246 paxwarn(0, "Destination directory was not supplied");
1250 if (mkpath(dirptr) < 0)
1260 * no read errors allowed on updates/append operation!
1263 while ((str = get_line(stdin)) != NULL) {
1266 if (get_line_error) {
1267 paxwarn(1, "Problem while reading stdin");
1279 * print out those invalid flag sets found to the user
1283 printflg(unsigned int flg)
1288 (void)fprintf(stderr,"%s: Invalid combination of options:", argv0);
1289 while ((nxt = ffs(flg)) != 0) {
1292 (void)fprintf(stderr, " -%c", flgch[pos-1]);
1294 (void)putc('\n', stderr);
1299 * comparison routine used by bsearch to find the format specified
1304 c_frmt(const void *a, const void *b)
1306 return(strcmp(((const FSUB *)a)->name, ((const FSUB *)b)->name));
1311 * called by format specific options routines to get each format specific
1312 * flag and value specified with -o
1314 * pointer to next OPLIST entry or NULL (end of list).
1322 if ((opt = ophead) != NULL)
1323 ophead = ophead->fow;
1329 * generic routine used to complain about a format specific options
1330 * when the format does not support options.
1341 * print all we were given
1343 paxwarn(1,"These format options are not supported");
1344 while ((opt = opt_next()) != NULL)
1345 (void)fprintf(stderr, "\t%s = %s\n", opt->name, opt->value);
1352 * breaks the value supplied to -o into an option name and value. Options
1353 * are given to -o in the form -o name-value,name=value
1354 * multiple -o may be specified.
1356 * 0 if format in name=value format, -1 if -o is passed junk.
1360 opt_add(const char *str)
1368 if ((str == NULL) || (*str == '\0')) {
1369 paxwarn(0, "Invalid option name");
1372 if ((lstr = strdup(str)) == NULL) {
1373 paxwarn(0, "Unable to allocate space for option list");
1376 frpt = endpt = lstr;
1379 * break into name and values pieces and stuff each one into a
1380 * OPLIST structure. When we know the format, the format specific
1381 * option function will go through this list
1383 while ((frpt != NULL) && (*frpt != '\0')) {
1384 if ((endpt = strchr(frpt, ',')) != NULL)
1386 if ((pt = strchr(frpt, '=')) == NULL) {
1387 paxwarn(0, "Invalid options format");
1391 if ((opt = (OPLIST *)malloc(sizeof(OPLIST))) == NULL) {
1392 paxwarn(0, "Unable to allocate space for option list");
1396 lstr = NULL; /* parts of string going onto the OPLIST */
1405 if (ophead == NULL) {
1406 optail = ophead = opt;
1418 * Convert an expression of the following forms to an off_t > 0.
1419 * 1) A positive decimal number.
1420 * 2) A positive decimal number followed by a b (mult by 512).
1421 * 3) A positive decimal number followed by a k (mult by 1024).
1422 * 4) A positive decimal number followed by a m (mult by 512).
1423 * 5) A positive decimal number followed by a w (mult by sizeof int)
1424 * 6) Two or more positive decimal numbers (with/without k,b or w).
1425 * separated by x (also * for backwards compatibility), specifying
1426 * the product of the indicated values.
1428 * 0 for an error, a positive value o.w.
1438 num = strtol(val, &expr, 0);
1439 if ((num == LONG_MAX) || (num <= 0) || (expr == val))
1441 num = strtoq(val, &expr, 0);
1442 if ((num == QUAD_MAX) || (num <= 0) || (expr == val))
1483 num *= str_offt(expr + 1);
1499 name = fgetln(f, &len);
1501 get_line_error = ferror(f) ? GETLINE_FILE_CORRUPT : 0;
1504 if (name[len-1] != '\n')
1508 get_line_error = GETLINE_OUT_OF_MEM;
1511 memcpy(temp, name, len-1);
1518 * for those option functions where the archive format has nothing to do.
1531 * print the usage summary to the user
1537 (void)fputs("usage: pax [-cdnOvz] [-E limit] [-f archive] ", stderr);
1538 (void)fputs("[-s replstr] ... [-U user] ...", stderr);
1539 (void)fputs("\n [-G group] ... ", stderr);
1540 (void)fputs("[-T [from_date][,to_date]] ... ", stderr);
1541 (void)fputs("[pattern ...]\n", stderr);
1542 (void)fputs(" pax -r [-cdiknOuvzDYZ] [-E limit] ", stderr);
1543 (void)fputs("[-f archive] [-o options] ... \n", stderr);
1544 (void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
1545 (void)fputs("[-U user] ... [-G group] ...\n ", stderr);
1546 (void)fputs("[-T [from_date][,to_date]] ... ", stderr);
1547 (void)fputs(" [pattern ...]\n", stderr);
1548 (void)fputs(" pax -w [-dituvzHLOPX] [-b blocksize] ", stderr);
1549 (void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
1550 (void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
1551 (void)fputs("[-o options] ... [-U user] ...", stderr);
1552 (void)fputs("\n [-G group] ... ", stderr);
1553 (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1554 (void)fputs("[file ...]\n", stderr);
1555 (void)fputs(" pax -r -w [-diklntuvDHLOPXYZ] ", stderr);
1556 (void)fputs("[-p string] ... [-s replstr] ...", stderr);
1557 (void)fputs("\n [-U user] ... [-G group] ... ", stderr);
1558 (void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
1559 (void)fputs("\n [file ...] directory\n", stderr);
1565 * print the usage summary to the user
1571 (void)fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
1573 (void)fputs("[archive] [replstr] [-C directory] [-I file] [file ...]\n",
1580 * print the usage summary to the user
1586 (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
1587 (void)fputs(" [-F archive] < name-list [> archive]\n", stderr);
1588 (void)fputs(" cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);
1589 (void)fputs(" [-I archive] [-F archive] [pattern...] [< archive]\n", stderr);
1590 (void)fputs(" cpio -p [-adlLmuvV] destination-directory < name-list\n", stderr);