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 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * @(#)options.c 8.2 (Berkeley) 4/18/94
38 * $FreeBSD: src/bin/pax/options.c,v 1.13.2.3 2001/08/01 05:03:11 obrien Exp $
39 * $DragonFly: src/bin/pax/options.c,v 1.9 2008/06/05 18:06:30 swildner Exp $
42 #include <sys/types.h>
59 * Routines which handle command line options
62 static char flgch
[] = FLGCH
; /* list of all possible flags */
63 static OPLIST
*ophead
= NULL
; /* head for format specific options -x */
64 static OPLIST
*optail
= NULL
; /* option tail */
66 static int no_op (void);
67 static void printflg (unsigned int);
68 static int c_frmt (const void *, const void *);
69 static off_t
str_offt (char *);
70 static char *getline (FILE *);
71 static void pax_options (int, char **);
72 static void pax_usage (void);
73 static void tar_options (int, char **);
74 static void tar_usage (void);
75 static void cpio_options (int, char **);
76 static void cpio_usage (void);
77 static int mkpath(char *);
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 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 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 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 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
, 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
, 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 return(tar_options(argc
, argv
));
163 else if (strcmp(NM_CPIO
, argv0
) == 0)
164 return(cpio_options(argc
, argv
));
166 * assume pax as the default
169 return(pax_options(argc
, argv
));
174 * look at the user specified flags. set globals as required and check if
175 * the user specified a legal set of flags. If not, complain and exit
179 pax_options(int argc
, char **argv
)
183 unsigned int flg
= 0;
184 unsigned int bflg
= 0;
189 * process option flags
191 while ((c
=getopt(argc
,argv
,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ"))
205 if ((wrblksz
= (int)str_offt(optarg
)) <= 0) {
206 paxwarn(1, "Invalid block size %s", optarg
);
212 * inverse match on patterns
219 * match only dir on extract, not the subtree at dir
226 * filename where the archive is stored
233 * interactive file rename
240 * do not clobber files that exist
247 * try to link src to dest with copy (-rw)
254 * select first match for a pattern only
261 * pass format specific options
264 if (opt_add(optarg
) < 0)
269 * specify file characteristic options
271 for (pt
= optarg
; *pt
!= '\0'; ++pt
) {
275 * do not preserve access time
281 * preserve user id, group id, file
282 * mode, access/modification times
291 * do not preserve modification time
303 * preserve file mode bits
308 paxwarn(1, "Invalid -p string: %c", *pt
);
323 * file name substitution name pattern
325 if (rep_add(optarg
) < 0) {
333 * preserve access time on filesystem nodes we read
340 * ignore those older files
347 * verbose operation mode
360 * specify an archive format on write
363 if ((frmt
= (FSUB
*)bsearch((void *)&tmp
, (void *)fsub
,
364 sizeof(fsub
)/sizeof(FSUB
), sizeof(FSUB
), c_frmt
)) != NULL
) {
368 paxwarn(1, "Unknown -x format: %s", optarg
);
369 fputs("pax: Known -x formats are:", stderr
);
370 for (i
= 0; i
< (sizeof(fsub
)/sizeof(FSUB
)); ++i
)
371 fprintf(stderr
, " %s", fsub
[i
].name
);
372 fputs("\n\n", stderr
);
377 * use gzip. Non standard option.
379 gzip_program
= GZIP_CMD
;
383 * non-standard option on number of bytes written on a
384 * single archive volume.
386 if ((wrlimit
= str_offt(optarg
)) <= 0) {
387 paxwarn(1, "Invalid write limit %s", optarg
);
390 if (wrlimit
% BLKMULT
) {
391 paxwarn(1, "Write limit is not a %d byte multiple",
399 * On extraction check file inode change time before the
400 * modification of the file name. Non standard option.
407 * non-standard limit on read faults
408 * 0 indicates stop after first error, values
409 * indicate a limit, "NONE" try forever
412 if (strcmp(NONE
, optarg
) == 0)
414 else if ((maxflt
= atoi(optarg
)) < 0) {
415 paxwarn(1, "Error count value must be positive");
421 * non-standard option for selecting files within an
422 * archive by group (gid or name)
424 if (grp_add(optarg
) < 0) {
432 * follow command line symlinks only
446 * Force one volume. Non standard option.
448 force_one_volume
= 1;
452 * do NOT follow symlinks (default)
459 * non-standard option for selecting files within an
460 * archive by modification time range (lower,upper)
462 if (trng_add(optarg
) < 0) {
470 * non-standard option for selecting files within an
471 * archive by user (uid or name)
473 if (usr_add(optarg
) < 0) {
481 * do not pass over mount points in the file system
488 * On extraction check file inode change time after the
489 * modification of the file name. Non standard option.
496 * On extraction check modification time after the
497 * modification of the file name. Non standard option.
509 * figure out the operation mode of pax read,write,extract,copy,append
510 * or list. check that we have not been given a bogus set of flags
511 * for the operation mode.
517 } else if (ISEXTRACT(flg
)) {
520 } else if (ISARCHIVE(flg
)) {
523 } else if (ISAPPND(flg
)) {
526 } else if (ISCOPY(flg
)) {
537 * if we are writing (ARCHIVE) we use the default format if the user
538 * did not specify a format. when we write during an APPEND, we will
539 * adopt the format of the existing archive if none was supplied.
541 if (!(flg
& XF
) && (act
== ARCHIVE
))
542 frmt
= &(fsub
[DEFLT
]);
545 * process the args as they are interpreted by the operation mode
550 for (; optind
< argc
; optind
++)
551 if (pat_add(argv
[optind
], NULL
) < 0)
555 if (optind
>= argc
) {
556 paxwarn(0, "Destination directory was not supplied");
561 if (mkpath(dirptr
) < 0)
566 for (; optind
< argc
; optind
++)
567 if (ftree_add(argv
[optind
], 0) < 0)
570 * no read errors allowed on updates/append operation!
580 * look at the user specified flags. set globals as required and check if
581 * the user specified a legal set of flags. If not, complain and exit
585 tar_options(int argc
, char **argv
)
591 int incfiles_max
= 0;
596 struct incfile
*incfiles
= NULL
;
599 * Set default values.
604 * process option flags
606 while ((c
= getoldopt(argc
, argv
,
607 "b:cef:hjmopqruts:vwxyzBC:HI:LOPXZ014578")) != -1) {
611 * specify blocksize in 512-byte blocks
613 if ((wrblksz
= (int)str_offt(optarg
)) <= 0) {
614 paxwarn(1, "Invalid block size %s", optarg
);
617 wrblksz
*= 512; /* XXX - check for int oflow */
627 * stop after first error
633 * filename where the archive is stored
635 if ((optarg
[0] == '-') && (optarg
[1]== '\0')) {
655 * use bzip2. Non standard option.
657 gzip_program
= BZIP2_CMD
;
661 * do not preserve modification time
666 if (opt_add("write_opt=nodir") < 0)
673 * preserve uid/gid and file mode, regardless of umask
680 * select first match for a pattern only
687 * append to the archive
693 * file name substitution name pattern
695 if (rep_add(optarg
) < 0) {
702 * list contents of the tape
708 * verbose operation mode
714 * interactive file rename
720 * extract an archive, preserving mode,
721 * and mtime if possible.
728 * use gzip. Non standard option.
730 gzip_program
= GZIP_CMD
;
734 * Nothing to do here, this is pax default
742 * follow command line symlinks only
747 if (++nincfiles
> incfiles_max
) {
748 incfiles_max
= nincfiles
+ 3;
749 incfiles
= realloc(incfiles
,
750 sizeof(*incfiles
) * incfiles_max
);
751 if (incfiles
== NULL
) {
752 paxwarn(0, "Unable to allocate space "
757 incfiles
[nincfiles
- 1].file
= optarg
;
758 incfiles
[nincfiles
- 1].dir
= chdname
;
768 * do not remove leading '/' from pathnames
774 * do not pass over mount points in the file system
782 gzip_program
= COMPRESS_CMD
;
810 /* Traditional tar behaviour (pax uses stderr unless in list mode) */
811 if (fstdin
== 1 && act
== ARCHIVE
)
816 /* Traditional tar behaviour (pax wants to read file list from stdin) */
817 if ((act
== ARCHIVE
|| act
== APPND
) && argc
== 0 && nincfiles
== 0)
821 * if we are writing (ARCHIVE) specify tar, otherwise run like pax
822 * (unless -o specified)
824 if (act
== ARCHIVE
|| act
== APPND
)
825 frmt
= &(fsub
[Oflag
? F_OTAR
: F_TAR
]);
827 paxwarn(1, "The -O/-o options are only valid when writing an archive");
828 tar_usage(); /* only valid when writing */
832 * process the args as they are interpreted by the operation mode
840 char *file
, *dir
= NULL
;
842 while (nincfiles
|| *argv
!= NULL
) {
844 * If we queued up any include files,
845 * pull them in now. Otherwise, check
846 * for -I and -C positional flags.
847 * Anything else must be a file to
851 file
= incfiles
->file
;
855 } else if (strcmp(*argv
, "-I") == 0) {
866 if (strcmp(file
, "-") == 0)
868 else if ((fp
= fopen(file
, "r")) == NULL
) {
869 paxwarn(1, "Unable to open file '%s' for read", file
);
872 while ((str
= getline(fp
)) != NULL
) {
873 if (pat_add(str
, dir
) < 0)
877 if (strcmp(file
, "-") != 0)
880 paxwarn(1, "Problem with file '%s'", file
);
883 } else if (strcmp(*argv
, "-C") == 0) {
887 } else if (pat_add(*argv
++, chdname
) < 0)
893 * if patterns were added, we are doing chdir()
894 * on a file-by-file basis, else, just one
895 * global chdir (if any) after opening input.
903 if (chdname
!= NULL
) { /* initial chdir() */
904 if (ftree_add(chdname
, 1) < 0)
908 while (nincfiles
|| *argv
!= NULL
) {
909 char *file
, *dir
= NULL
;
912 * If we queued up any include files, pull them in
913 * now. Otherwise, check for -I and -C positional
914 * flags. Anything else must be a file to include
918 file
= incfiles
->file
;
922 } else if (strcmp(*argv
, "-I") == 0) {
933 /* Set directory if needed */
935 if (ftree_add(dir
, 1) < 0)
939 if (strcmp(file
, "-") == 0)
941 else if ((fp
= fopen(file
, "r")) == NULL
) {
942 paxwarn(1, "Unable to open file '%s' for read", file
);
945 while ((str
= getline(fp
)) != NULL
) {
946 if (ftree_add(str
, 0) < 0)
949 if (strcmp(file
, "-") != 0)
952 paxwarn(1, "Problem with file '%s'",
956 } else if (strcmp(*argv
, "-C") == 0) {
959 if (ftree_add(*argv
++, 1) < 0)
961 } else if (ftree_add(*argv
++, 0) < 0)
965 * no read errors allowed on updates/append operation!
970 if (!fstdin
&& ((arcname
== NULL
) || (*arcname
== '\0'))) {
971 arcname
= getenv("TAPE");
972 if ((arcname
== NULL
) || (*arcname
== '\0'))
973 arcname
= _PATH_DEFTAPE
;
987 slash
+= strspn(slash
, "/");
988 slash
+= strcspn(slash
, "/");
990 done
= (*slash
== '\0');
993 if (stat(path
, &sb
)) {
994 if (errno
!= ENOENT
|| mkdir(path
, 0777)) {
995 paxwarn(1, "%s", path
);
998 } else if (!S_ISDIR(sb
.st_mode
)) {
999 syswarn(1, ENOTDIR
, "%s", path
);
1011 * look at the user specified flags. set globals as required and check if
1012 * the user specified a legal set of flags. If not, complain and exit
1016 cpio_options(int argc
, char **argv
)
1031 while ((c
=getopt(argc
,argv
,"abcdfiklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
1035 * preserve access time on files read
1041 * swap bytes and half-words when reading data
1048 frmt
= &(fsub
[F_ACPIO
]);
1052 * create directories as needed
1058 * invert meaning of pattern list
1064 * restore an archive
1072 * use links instead of copies when possible
1078 * preserve modification time
1087 frmt
= &(fsub
[F_CPIO
]);
1097 * interactively rename files
1103 * swap bytes after reading data
1108 * list contents of archive
1115 * replace newer files
1121 * verbose operation mode
1127 * use gzip. Non standard option.
1129 gzip_program
= GZIP_CMD
;
1139 * Use 5120 byte block size
1145 * set block size in bytes
1147 wrblksz
= atoi(optarg
);
1151 * file with patterns to extract or list
1153 if ((fp
= fopen(optarg
, "r")) == NULL
) {
1154 paxwarn(1, "Unable to open file '%s' for read", optarg
);
1157 while ((str
= getline(fp
)) != NULL
) {
1161 if (getline_error
) {
1162 paxwarn(1, "Problem with file '%s'", optarg
);
1170 * filename where the archive is stored
1172 if ((optarg
[0] == '-') && (optarg
[1]== '\0')) {
1174 * treat a - as stdin
1183 * specify an archive format on write
1186 if ((frmt
= (FSUB
*)bsearch((void *)&tmp
, (void *)fsub
,
1187 sizeof(fsub
)/sizeof(FSUB
), sizeof(FSUB
), c_frmt
)) != NULL
)
1189 paxwarn(1, "Unknown -H format: %s", optarg
);
1190 fputs("cpio: Known -H formats are:", stderr
);
1191 for (i
= 0; i
< (sizeof(fsub
)/sizeof(FSUB
)); ++i
)
1192 fprintf(stderr
, " %s", fsub
[i
].name
);
1193 fputs("\n\n", stderr
);
1198 * follow symbolic links
1204 * swap halfwords after reading data
1209 * use compress. Non standard option.
1211 gzip_program
= COMPRESS_CMD
;
1215 * process Version 6 cpio format
1217 frmt
= &(fsub
[F_OCPIO
]);
1228 * process the args as they are interpreted by the operation mode
1233 while (*argv
!= NULL
)
1234 if (pat_add(*argv
++, NULL
) < 0)
1238 if (*argv
== NULL
) {
1239 paxwarn(0, "Destination directory was not supplied");
1243 if (mkpath(dirptr
) < 0)
1253 * no read errors allowed on updates/append operation!
1256 while ((str
= getline(stdin
)) != NULL
) {
1259 if (getline_error
) {
1260 paxwarn(1, "Problem while reading stdin");
1272 * print out those invalid flag sets found to the user
1276 printflg(unsigned int flg
)
1281 fprintf(stderr
,"%s: Invalid combination of options:", argv0
);
1282 while ((nxt
= ffs(flg
)) != 0) {
1285 fprintf(stderr
, " -%c", flgch
[pos
-1]);
1292 * comparison routine used by bsearch to find the format specified
1297 c_frmt(const void *a
, const void *b
)
1299 return(strcmp(((FSUB
*)a
)->name
, ((FSUB
*)b
)->name
));
1304 * called by format specific options routines to get each format specific
1305 * flag and value specified with -o
1307 * pointer to next OPLIST entry or NULL (end of list).
1315 if ((opt
= ophead
) != NULL
)
1316 ophead
= ophead
->fow
;
1322 * generic routine used to complain about a format specific options
1323 * when the format does not support options.
1334 * print all we were given
1336 paxwarn(1,"These format options are not supported");
1337 while ((opt
= opt_next()) != NULL
)
1338 fprintf(stderr
, "\t%s = %s\n", opt
->name
, opt
->value
);
1345 * breaks the value supplied to -o into a option name and value. options
1346 * are given to -o in the form -o name-value,name=value
1347 * multiple -o may be specified.
1349 * 0 if format in name=value format, -1 if -o is passed junk
1360 if ((str
== NULL
) || (*str
== '\0')) {
1361 paxwarn(0, "Invalid option name");
1364 if ((str
= strdup(str
)) == NULL
) {
1365 paxwarn(0, "Unable to allocate space for option list");
1371 * break into name and values pieces and stuff each one into a
1372 * OPLIST structure. When we know the format, the format specific
1373 * option function will go through this list
1375 while ((frpt
!= NULL
) && (*frpt
!= '\0')) {
1376 if ((endpt
= strchr(frpt
, ',')) != NULL
)
1378 if ((pt
= strchr(frpt
, '=')) == NULL
) {
1379 paxwarn(0, "Invalid options format");
1383 if ((opt
= (OPLIST
*)malloc(sizeof(OPLIST
))) == NULL
) {
1384 paxwarn(0, "Unable to allocate space for option list");
1396 if (ophead
== NULL
) {
1397 optail
= ophead
= opt
;
1408 * Convert an expression of the following forms to an off_t > 0.
1409 * 1) A positive decimal number.
1410 * 2) A positive decimal number followed by a b (mult by 512).
1411 * 3) A positive decimal number followed by a k (mult by 1024).
1412 * 4) A positive decimal number followed by a m (mult by 512).
1413 * 5) A positive decimal number followed by a w (mult by sizeof int)
1414 * 6) Two or more positive decimal numbers (with/without k,b or w).
1415 * separated by x (also * for backwards compatibility), specifying
1416 * the product of the indicated values.
1418 * 0 for an error, a positive value o.w.
1427 num
= strtoq(val
, &expr
, 0);
1428 if ((num
== QUAD_MAX
) || (num
<= 0) || (expr
== val
))
1468 num
*= str_offt(expr
+ 1);
1484 name
= fgetln(f
, &len
);
1486 getline_error
= ferror(f
) ? GETLINE_FILE_CORRUPT
: 0;
1489 if (name
[len
-1] != '\n')
1493 getline_error
= GETLINE_OUT_OF_MEM
;
1496 memcpy(temp
, name
, len
-1);
1503 * for those option functions where the archive format has nothing to do.
1516 * print the usage summary to the user
1522 fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr
);
1523 fputs("[-s replstr] ... [-U user] ...", stderr
);
1524 fputs("\n [-G group] ... ", stderr
);
1525 fputs("[-T [from_date][,to_date]] ... ", stderr
);
1526 fputs("[pattern ...]\n", stderr
);
1527 fputs(" pax -r [-cdiknuvzDYZ] [-E limit] ", stderr
);
1528 fputs("[-f archive] [-o options] ... \n", stderr
);
1529 fputs(" [-p string] ... [-s replstr] ... ", stderr
);
1530 fputs("[-U user] ... [-G group] ...\n ", stderr
);
1531 fputs("[-T [from_date][,to_date]] ... ", stderr
);
1532 fputs(" [pattern ...]\n", stderr
);
1533 fputs(" pax -w [-dituvzHLPX] [-b blocksize] ", stderr
);
1534 fputs("[ [-a] [-f archive] ] [-x format] \n", stderr
);
1535 fputs(" [-B bytes] [-s replstr] ... ", stderr
);
1536 fputs("[-o options] ... [-U user] ...", stderr
);
1537 fputs("\n [-G group] ... ", stderr
);
1538 fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr
);
1539 fputs("[file ...]\n", stderr
);
1540 fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr
);
1541 fputs("[-p string] ... [-s replstr] ...", stderr
);
1542 fputs("\n [-U user] ... [-G group] ... ", stderr
);
1543 fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr
);
1544 fputs("\n [file ...] directory\n", stderr
);
1550 * print the usage summary to the user
1556 fputs("usage: tar [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] ",
1558 fputs("[archive] [replstr] [-C directory] [-I file] [file ...]\n",
1565 * print the usage summary to the user
1571 fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr
);
1572 fputs(" [-F archive] < name-list [> archive]\n", stderr
);
1573 fputs(" cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr
);
1574 fputs(" [-I archive] [-F archive] [pattern...] [< archive]\n", stderr
);
1575 fputs(" cpio -p [-adlLmuvV] destination-directory < name-list\n", stderr
);