Re-add -P option (for POSIX-like command line interface)

This commit is contained in:
Andrey A. Chernov 2000-09-25 16:24:22 +00:00
parent 4451405fbd
commit 86ab37762e
2 changed files with 11 additions and 6 deletions

View file

@ -40,7 +40,7 @@
.Nd map a directory hierarchy
.Sh SYNOPSIS
.Nm mtree
.Op Fl LUcdeinqrux
.Op Fl LPUcdeinqrux
.Bk -words
.Op Fl f Ar spec
.Ek
@ -71,9 +71,10 @@ missing from either the file hierarchy or the specification.
The options are as follows:
.Bl -tag -width flag
.It Fl L
Follow all symbolic links in the file hierarchy (by default
.Nm
considers the symbolic link itself).
Follow all symbolic links in the file hierarchy.
.It Fl P
Don't follow symbolic links in the file hierarchy, instead consider
the symbolic link itself in any comparisons. This is the default.
.It Fl U
Modify the owner, group and permissions of existing files to match
the specification and create any missing directories or symbolic links.

View file

@ -77,7 +77,7 @@ main(argc, argv)
keys = KEYDEFAULT;
init_excludes();
while ((ch = getopt(argc, argv, "cdef:iK:k:Lnp:qrs:UuxX:")) != -1)
while ((ch = getopt(argc, argv, "cdef:iK:k:LnPp:qrs:UuxX:")) != -1)
switch((char)ch) {
case 'c':
cflag = 1;
@ -113,6 +113,10 @@ main(argc, argv)
case 'n':
nflag = 1;
break;
case 'P':
ftsoptions &= ~FTS_LOGICAL;
ftsoptions |= FTS_PHYSICAL;
break;
case 'p':
dir = optarg;
break;
@ -170,7 +174,7 @@ static void
usage()
{
(void)fprintf(stderr,
"usage: mtree [-LUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
"usage: mtree [-LPUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
"\t[-X excludes]\n");
exit(1);
}