#include "tar.h"
#include "extern.h"
+#include "fgetln.h" /* added, David */
+
/*
* Routines which handle command line options
*/
#define GZIP_CMD "gzip" /* command to run as gzip */
#define COMPRESS_CMD "compress" /* command to run as compress */
+#define BZIP2_CMD "bzip2" /* command to run as bzip2 */
/*
* Format specific routine table - MUST BE IN SORTED ORDER BY NAME
/*
* process option flags
*/
- while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ"))
+ while ((c=getopt(argc,argv,"ab:cdf:ijklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ"))
!= EOF) {
switch (c) {
case 'a':
iflag = 1;
flg |= IF;
break;
+ case 'j':
+ /*
+ * use bzip2. Non standard option.
+ */
+ zflag = 1;
+ gzip_program = BZIP2_CMD;
+ break;
case 'k':
/*
* do not clobber files that exist
* process option flags
*/
while ((c = getoldopt(argc, argv,
- "b:cef:hmopruts:vwxzBC:HLOPXZ014578"))
+ "b:cef:hjmopruts:vwxzBC:HLOPXZ014578"))
!= EOF) {
switch(c) {
case 'b':
*/
Lflag = 1;
break;
+ case 'j':
+ /*
+ * use bzip2. Non standard option.
+ */
+ zflag = 1;
+ gzip_program = BZIP2_CMD;
+ break;
case 'm':
/*
* do not preserve modification time
dflag = 1;
act = -1;
nodirs = 1;
- while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LO:SZ6")) != EOF)
+ while ((c=getopt(argc,argv,"abcdfijklmoprstuvzABC:E:F:H:I:LO:SZ6")) != EOF)
switch (c) {
case 'a':
/*
*/
act = EXTRACT;
break;
+ case 'j':
+ /*
+ * use bzip2. Non standard option.
+ */
+ zflag = 1;
+ gzip_program = BZIP2_CMD;
+ break;
case 'k':
break;
case 'l':
pax_usage()
#endif
{
- (void)fputs("usage: pax [-cdnv] [-E limit] [-f archive] ", stderr);
+ (void)fputs("usage: pax [-cdjnvz] [-E limit] [-f archive] ", stderr);
(void)fputs("[-s replstr] ... [-U user] ...", stderr);
(void)fputs("\n [-G group] ... ", stderr);
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
(void)fputs("[pattern ...]\n", stderr);
- (void)fputs(" pax -r [-cdiknuvDYZ] [-E limit] ", stderr);
+ (void)fputs(" pax -r [-cdijknuvzDYZ] [-E limit] ", stderr);
(void)fputs("[-f archive] [-o options] ... \n", stderr);
(void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
(void)fputs(" [pattern ...]\n", stderr);
- (void)fputs(" pax -w [-dituvHLPX] [-b blocksize] ", stderr);
+ (void)fputs(" pax -w [-dijtuvzHLPX] [-b blocksize] ", stderr);
(void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
(void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
(void)fputs("[-o options] ... [-U user] ...", stderr);
tar_usage()
#endif
{
- (void)fputs("usage: tar -{txru}[cevfbmopswzBHLPXZ014578] [tapefile] ",
+ (void)fputs("usage: tar -{txru}[cevfbjmopswzBHLPXZ014578] [tapefile] ",
stderr);
(void)fputs("[blocksize] [replstr] [-C directory] file1 file2...\n",
stderr);
cpio_usage()
#endif
{
- (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
+ (void)fputs("usage: cpio -o [-aABcjLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr);
(void)fputs(" [-F archive] < name-list [> archive]\n", stderr);
- (void)fputs(" cpio -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);
+ (void)fputs(" cpio -i [-bBcdfjmnrsStuvVzZ6] [-C bytes] [-E file] [-H format]\n", stderr);
(void)fputs(" [-I archive] [-F archive] [pattern...] [< archive]\n", stderr);
(void)fputs(" cpio -p [-adlLmuvV] destination-directory < name-list\n", stderr);
exit(1);