diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-09 12:02:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-12-09 12:02:18 +0000 |
commit | a30b131f9b30b35898631a3e28758eed7a5cbc8d (patch) | |
tree | 7d138f85fef3e7c6a71a870d077a222cce8251d5 /bin/pax/options.c | |
parent | d5046aac533bf79016f48a1264cf6ce6094a5240 (diff) |
support pax '-s replstr' option in tar mode too. this can be used to
deal with cleaning up absolute paths
Diffstat (limited to 'bin/pax/options.c')
-rw-r--r-- | bin/pax/options.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c index 4bdffe20d88..8d84828272f 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.11 1996/12/09 12:00:15 deraadt Exp $ */ +/* $OpenBSD: options.c,v 1.12 1996/12/09 12:02:16 deraadt Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: options.c,v 1.11 1996/12/09 12:00:15 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: options.c,v 1.12 1996/12/09 12:02:16 deraadt Exp $"; #endif #endif /* not lint */ @@ -605,7 +605,8 @@ tar_options(argc, argv) /* * process option flags */ - while ((c = getoldopt(argc, argv, "b:cef:hmoprutvwxzBC:HLPXZ014578")) + while ((c = getoldopt(argc, argv, + "b:cef:hmopruts:vwxzBC:HLPXZ014578")) != EOF) { switch(c) { case 'b': @@ -677,6 +678,15 @@ tar_options(argc, argv) */ act = APPND; break; + case 's': + /* + * file name substitution name pattern + */ + if (rep_add(optarg) < 0) { + tar_usage(); + break; + } + break; case 't': /* * list contents of the tape @@ -1178,9 +1188,10 @@ void tar_usage() #endif { - (void)fputs("usage: tar -{txru}[cevfbmopwzBHLPXZ014578] [tapefile] ", + (void)fputs("usage: tar -{txru}[cevfbmopswzBHLPXZ014578] [tapefile] ", stderr); - (void)fputs("[blocksize] [-C directory] file1 file2...\n", stderr); + (void)fputs("[blocksize] [replstr] [-C directory] file1 file2...\n", + stderr); exit(1); } |