diff options
author | wollman <wollman@FreeBSD.org> | 2000-05-12 03:03:00 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 2000-05-12 03:03:00 +0000 |
commit | 198f09c6490f91ae9c9c8efea0c89ab39cf74eae (patch) | |
tree | 449573864446544da5244e027fd71c8143d7aabf /usr.sbin/mtree/mtree.c | |
parent | 1ec3688bd005be0ac734c873c8de9e941e8ee02c (diff) | |
download | FreeBSD-src-198f09c6490f91ae9c9c8efea0c89ab39cf74eae.zip FreeBSD-src-198f09c6490f91ae9c9c8efea0c89ab39cf74eae.tar.gz |
Give mtree the ability to exclude files and directories from its traversal.
PR: 16944
Diffstat (limited to 'usr.sbin/mtree/mtree.c')
-rw-r--r-- | usr.sbin/mtree/mtree.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c index c8ac609..ee4eb50 100644 --- a/usr.sbin/mtree/mtree.c +++ b/usr.sbin/mtree/mtree.c @@ -75,7 +75,9 @@ main(argc, argv) dir = NULL; keys = KEYDEFAULT; - while ((ch = getopt(argc, argv, "cdef:iK:k:np:rs:Uux")) != -1) + init_excludes(); + + while ((ch = getopt(argc, argv, "cdef:iK:k:np:rs:UuxX:")) != -1) switch((char)ch) { case 'c': cflag = 1; @@ -128,6 +130,9 @@ main(argc, argv) case 'x': ftsoptions |= FTS_XDEV; break; + case 'X': + read_excludes_file(optarg); + break; case '?': default: usage(); @@ -158,6 +163,7 @@ static void usage() { (void)fprintf(stderr, -"usage: mtree [-cdeinrUux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"); +"usage: mtree [-cdeinrUux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n" +"\t[-X excludes]\n"); exit(1); } |