diff options
author | obrien <obrien@FreeBSD.org> | 1999-11-27 19:25:08 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1999-11-27 19:25:08 +0000 |
commit | 9fc872877e2cdc38e087f03f84b5fd16fa9fe726 (patch) | |
tree | 7e3d8b9e29278320c588ae031478d729880fac45 /bin/chmod | |
parent | 2f018faacfb1029c34f625656e7cb95bc93e57d8 (diff) | |
download | FreeBSD-src-9fc872877e2cdc38e087f03f84b5fd16fa9fe726.zip FreeBSD-src-9fc872877e2cdc38e087f03f84b5fd16fa9fe726.tar.gz |
Add "-v".
Diffstat (limited to 'bin/chmod')
-rw-r--r-- | bin/chmod/chmod.1 | 9 | ||||
-rw-r--r-- | bin/chmod/chmod.c | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/bin/chmod/chmod.1 b/bin/chmod/chmod.1 index 9726006..4fbf255 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 21841c6..4c06407 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); } |