diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-03-15 03:18:24 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-03-15 03:18:24 +0000 |
commit | 5e0e875a01f09de48f7145bca908708b97eef9dc (patch) | |
tree | 8962a0d7cea2ca5ee55ff159466ffa8b6e66a427 /usr.bin/tar | |
parent | 9d6da14ce1447b210a5bb9e5b2cda65fc9e73e8e (diff) | |
download | FreeBSD-src-5e0e875a01f09de48f7145bca908708b97eef9dc.zip FreeBSD-src-5e0e875a01f09de48f7145bca908708b97eef9dc.tar.gz |
Support -q (from NetBSD) as a synonym for --fast-read (the old FreeBSD
extension to GNU tar).
Thanks to: Joerg Sonnenberger
Diffstat (limited to 'usr.bin/tar')
-rw-r--r-- | usr.bin/tar/bsdtar.1 | 18 | ||||
-rw-r--r-- | usr.bin/tar/bsdtar.c | 9 |
2 files changed, 13 insertions, 14 deletions
diff --git a/usr.bin/tar/bsdtar.1 b/usr.bin/tar/bsdtar.1 index 64511ec..447091b 100644 --- a/usr.bin/tar/bsdtar.1 +++ b/usr.bin/tar/bsdtar.1 @@ -174,15 +174,6 @@ If not specified, the default tape device will be used. .Fx , the default tape device is .Pa /dev/sa0 . ) -.It Fl -fast-read ( Fl W Cm fast-read ) -(x and t mode only) -Extract or list only the first archive entry that matches each pattern -or filename operand. -Exit as soon as each specified pattern or filename has been matched. -By default, the archive is always read to the very end, since -there can be multiple entries with the same name and, by convention, -later entries overwrite earlier entries. -This option is provided as a performance optimization. .It Fl H (c and r mode only) Symbolic links named on the command line will be followed; the @@ -319,6 +310,15 @@ If is being run by root, the default is to restore the owner unless the .Fl o option is also specified. +.It Fl q ( Fl -fast-read ) +(x and t mode only) +Extract or list only the first archive entry that matches each pattern +or filename operand. +Exit as soon as each specified pattern or filename has been matched. +By default, the archive is always read to the very end, since +there can be multiple entries with the same name and, by convention, +later entries overwrite earlier entries. +This option is provided as a performance optimization. .It Fl -strip-components Ar count ( Fl W Cm strip-components Ns = Ns Ar count ) (x and t mode only) Remove the specified number of leading path elements. diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index fb16a93..103d88c 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -139,7 +139,6 @@ enum { OPTION_CHECK_LINKS=1, OPTION_CHROOT, OPTION_EXCLUDE, - OPTION_FAST_READ, OPTION_FORMAT, OPTION_HELP, OPTION_INCLUDE, @@ -181,7 +180,7 @@ static const struct option tar_longopts[] = { { "exclude", required_argument, NULL, OPTION_EXCLUDE }, { "exclude-from", required_argument, NULL, 'X' }, { "extract", no_argument, NULL, 'x' }, - { "fast-read", no_argument, NULL, OPTION_FAST_READ }, + { "fast-read", no_argument, NULL, 'q' }, { "file", required_argument, NULL, 'f' }, { "files-from", required_argument, NULL, 'T' }, { "format", required_argument, NULL, OPTION_FORMAT }, @@ -341,9 +340,6 @@ main(int argc, char **argv) if (strcmp(bsdtar->filename, "-") == 0) bsdtar->filename = NULL; break; - case OPTION_FAST_READ: /* GNU tar */ - bsdtar->option_fast_read = 1; - break; case 'H': /* BSD convention */ bsdtar->symlink_mode = 'H'; break; @@ -491,6 +487,9 @@ main(int argc, char **argv) case OPTION_POSIX: /* GNU tar */ bsdtar->create_format = "pax"; break; + case 'q': /* FreeBSD GNU tar --fast-read, NetBSD -q */ + bsdtar->option_fast_read = 1; + break; case 'r': /* SUSv2 */ set_mode(bsdtar, opt); break; |