diff options
author | Marc Espie <espie@cvs.openbsd.org> | 1999-07-04 18:21:13 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 1999-07-04 18:21:13 +0000 |
commit | fea10b6c94f5bec12718c06530ab5157e80a5f50 (patch) | |
tree | 43417cad30820131c956b06d01c617076a2de754 /bin | |
parent | 03ec60011e8900659b86b3768304a19bf9dcc607 (diff) |
New: tar -q option (for quick)
same as pax -n. Useful for packages.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pax/options.c | 14 | ||||
-rw-r--r-- | bin/pax/tar.1 | 12 |
2 files changed, 20 insertions, 6 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c index bc097b1b556..f68dd504f76 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.37 1999/05/23 17:19:22 aaron Exp $ */ +/* $OpenBSD: options.c,v 1.38 1999/07/04 18:21:11 espie 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.37 1999/05/23 17:19:22 aaron Exp $"; +static char rcsid[] = "$OpenBSD: options.c,v 1.38 1999/07/04 18:21:11 espie Exp $"; #endif #endif /* not lint */ @@ -613,7 +613,7 @@ tar_options(argc, argv) * process option flags */ while ((c = getoldopt(argc, argv, - "b:cef:hmopruts:vwxzBC:HLOPXZ014578")) + "b:cef:hmopqruts:vwxzBC:HLOPXZ014578")) != -1) { switch(c) { case 'b': @@ -678,6 +678,12 @@ tar_options(argc, argv) pmode = 1; pids = 1; break; + case 'q': + /* + * select first match for a pattern only + */ + nflag = 1; + break; case 'r': case 'u': /* @@ -1495,7 +1501,7 @@ void tar_usage() #endif { - (void)fputs("usage: tar -{txru}[cevfbmopswzBHLPXZ014578] [tapefile] ", + (void)fputs("usage: tar -{txru}[cevfbmopqswzBHLPXZ014578] [tapefile] ", stderr); (void)fputs("[blocksize] [replstr] [-C directory] file1 file2...\n", stderr); diff --git a/bin/pax/tar.1 b/bin/pax/tar.1 index 8f54dca1621..e64cbaf3243 100644 --- a/bin/pax/tar.1 +++ b/bin/pax/tar.1 @@ -27,7 +27,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $OpenBSD: tar.1,v 1.20 1998/12/15 01:20:25 aaron Exp $ +.\" $OpenBSD: tar.1,v 1.21 1999/07/04 18:21:12 espie Exp $ .\" .Dd June 11, 1996 .Dt TAR 1 @@ -38,7 +38,7 @@ .Sh SYNOPSIS .Nm tar .Sm off -.Oo \&- Oc {crtux} Op Fl befhmopvwzHLOPXZ014578 +.Oo \&- Oc {crtux} Op Fl befhmopqvwzHLOPXZ014578 .Sm on .Op Ar archive .Op Ar blocksize @@ -121,6 +121,14 @@ The setuid and setgid bits are only preserved if the user is the superuser. Only meaningful in conjunction with the .Fl x flag. +.It Fl q +Select the first archive member that matches each +.Ar pattern +operand. +No more than one archive member is matched for each +.Ar pattern . +When members of type directory are matched, the file hierarchy rooted at that +directory is also matched. .It Fl s Ar replstr Modify the file or archive member names specified by the .Ar pattern |