aboutsummaryrefslogtreecommitdiff
path: root/bin/chmod
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1999-11-27 19:25:08 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1999-11-27 19:25:08 +0000
commit5bb83b98dbde8326de7b8221ef899ca38ddb3180 (patch)
treeca6b76e491203b47f9150fb3baf3b6a4128912e4 /bin/chmod
parentc628363b9820c18fd5810f29f8cb5f383cac626f (diff)
downloadsrc-5bb83b98dbde8326de7b8221ef899ca38ddb3180.tar.gz
src-5bb83b98dbde8326de7b8221ef899ca38ddb3180.zip
Add "-v".
Notes
Notes: svn path=/head/; revision=53780
Diffstat (limited to 'bin/chmod')
-rw-r--r--bin/chmod/chmod.19
-rw-r--r--bin/chmod/chmod.c11
2 files changed, 18 insertions, 2 deletions
diff --git a/bin/chmod/chmod.1 b/bin/chmod/chmod.1
index 9726006ea23c..4fbf25558712 100644
--- a/bin/chmod/chmod.1
+++ b/bin/chmod/chmod.1
@@ -47,6 +47,7 @@
.Fl f
.Fl R
.Op Fl H | Fl L | Fl P
+.Fl v
.Oc
.Ar mode
.Ar file ...
@@ -80,6 +81,10 @@ instead of just the files themselves.
Do not display a diagnostic message if
.Nm
could not modify the mode for
+.It Fl v
+Cause
+.Nm
+to be verbose, showing files as the mode is modified.
.Va file .
.El
.Pp
@@ -307,6 +312,10 @@ set the group bits equal to the user bits, but clear the group write bit.
There's no
.Ar perm
option for the naughty bits.
+.Sh COMPATIBILITY
+The
+.Fl v
+option is non-standard and its use in scripts is not recommended.
.Sh SEE ALSO
.Xr chflags 1 ,
.Xr install 1 ,
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index 21841c6fdc17..4c06407878fb 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -70,12 +70,13 @@ main(argc, argv)
long val;
int oct, omode;
int Hflag, Lflag, Pflag, Rflag, ch, fflag, fts_options, hflag, rval;
+ int vflag;
char *ep, *mode;
set = NULL;
omode = 0;
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
- while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != -1)
+ while ((ch = getopt(argc, argv, "HLPRXfgorstuvwx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -118,6 +119,9 @@ main(argc, argv)
argv[optind - 1][2] == '\0')
--optind;
goto done;
+ case 'v':
+ vflag = 1;
+ break;
case '?':
default:
usage();
@@ -191,6 +195,9 @@ done: argv += optind;
getmode(set, p->fts_statp->st_mode)) && !fflag) {
warn(p->fts_path);
rval = 1;
+ } else {
+ if (vflag)
+ (void)printf("%s\n", p->fts_accpath);
}
}
if (errno)
@@ -203,6 +210,6 @@ void
usage()
{
(void)fprintf(stderr,
- "usage: chmod [-f -R [-H | -L | -P]] mode file ...\n");
+ "usage: chmod [-f -R [-H | -L | -P] -v] mode file ...\n");
exit(1);
}