Restore standard symlink default, return -L, remove -P, add missing -q to getopt
This is part of whole subsystem fixing Reviewed by: imp
This commit is contained in:
parent
83706e2f74
commit
b436b49df3
@ -40,7 +40,7 @@
|
|||||||
.Nd map a directory hierarchy
|
.Nd map a directory hierarchy
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm mtree
|
.Nm mtree
|
||||||
.Op Fl PUcdeinqrux
|
.Op Fl LUcdeinqrux
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl f Ar spec
|
.Op Fl f Ar spec
|
||||||
.Ek
|
.Ek
|
||||||
@ -70,9 +70,10 @@ missing from either the file hierarchy or the specification.
|
|||||||
.Pp
|
.Pp
|
||||||
The options are as follows:
|
The options are as follows:
|
||||||
.Bl -tag -width flag
|
.Bl -tag -width flag
|
||||||
.It Fl P
|
.It Fl L
|
||||||
Don't follow symbolic links in the file hierarchy, instead consider
|
Follow all symbolic links in the file hierarchy (by default
|
||||||
the symbolic link itself in any comparisons.
|
.Nm
|
||||||
|
considers the symbolic link itself).
|
||||||
.It Fl U
|
.It Fl U
|
||||||
Modify the owner, group and permissions of existing files to match
|
Modify the owner, group and permissions of existing files to match
|
||||||
the specification and create any missing directories or symbolic links.
|
the specification and create any missing directories or symbolic links.
|
||||||
|
@ -57,7 +57,7 @@ static const char rcsid[] =
|
|||||||
|
|
||||||
extern long int crc_total;
|
extern long int crc_total;
|
||||||
|
|
||||||
int ftsoptions = FTS_LOGICAL;
|
int ftsoptions = FTS_PHYSICAL;
|
||||||
int cflag, dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, Uflag;
|
int cflag, dflag, eflag, iflag, nflag, qflag, rflag, sflag, uflag, Uflag;
|
||||||
u_int keys;
|
u_int keys;
|
||||||
char fullpath[MAXPATHLEN];
|
char fullpath[MAXPATHLEN];
|
||||||
@ -77,7 +77,7 @@ main(argc, argv)
|
|||||||
keys = KEYDEFAULT;
|
keys = KEYDEFAULT;
|
||||||
init_excludes();
|
init_excludes();
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "cdef:iK:k:np:Prs:UuxX:")) != -1)
|
while ((ch = getopt(argc, argv, "cdef:iK:k:Lnp:qrs:UuxX:")) != -1)
|
||||||
switch((char)ch) {
|
switch((char)ch) {
|
||||||
case 'c':
|
case 'c':
|
||||||
cflag = 1;
|
cflag = 1;
|
||||||
@ -106,6 +106,10 @@ main(argc, argv)
|
|||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
keys |= parsekey(p, NULL);
|
keys |= parsekey(p, NULL);
|
||||||
break;
|
break;
|
||||||
|
case 'L':
|
||||||
|
ftsoptions &= ~FTS_PHYSICAL;
|
||||||
|
ftsoptions |= FTS_LOGICAL;
|
||||||
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
nflag = 1;
|
nflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -115,10 +119,6 @@ main(argc, argv)
|
|||||||
case 'q':
|
case 'q':
|
||||||
qflag = 1;
|
qflag = 1;
|
||||||
break;
|
break;
|
||||||
case 'P':
|
|
||||||
ftsoptions ^= FTS_LOGICAL;
|
|
||||||
ftsoptions |= FTS_PHYSICAL;
|
|
||||||
break;
|
|
||||||
case 'r':
|
case 'r':
|
||||||
rflag = 1;
|
rflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -170,7 +170,7 @@ static void
|
|||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"usage: mtree [-PUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
|
"usage: mtree [-LUcdeinqrux] [-f spec] [-K key] [-k key] [-p path] [-s seed]\n"
|
||||||
"\t[-X excludes]\n");
|
"\t[-X excludes]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user