chmod, chown: remove redundant flag

This commit is contained in:
Connor Lane Smith 2012-05-25 21:52:01 +01:00
parent 95ea9d4a00
commit 20d526391d
4 changed files with 9 additions and 11 deletions

View File

@ -3,12 +3,12 @@
chmod \- change file mode chmod \- change file mode
.SH SYNOPSIS .SH SYNOPSIS
.B chmod .B chmod
.RB [ \-Rr ] .RB [ \-r ]
.I octal .I octal
.RI [ file ...] .RI [ file ...]
.P .P
.B chmod .B chmod
.RB [ \-Rr ] .RB [ \-r ]
.RB [ ugoa ]*[ +-= ][ rwxs ]* .RB [ ugoa ]*[ +-= ][ rwxs ]*
.RI [ file ...] .RI [ file ...]
.SH DESCRIPTION .SH DESCRIPTION
@ -65,7 +65,7 @@ setuid and setgid attributes.
.PD .PD
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-R, \-r .B \-r
change directory mode recursively. change directory mode recursively.
.SH SEE ALSO .SH SEE ALSO
.IR chmod (2) .IR chmod (2)

View File

@ -18,9 +18,8 @@ main(int argc, char *argv[])
{ {
char c; char c;
while((c = getopt(argc, argv, "Rr")) != -1) while((c = getopt(argc, argv, "r")) != -1)
switch(c) { switch(c) {
case 'R':
case 'r': case 'r':
rflag = true; rflag = true;
break; break;
@ -28,7 +27,7 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if(optind == argc) if(optind == argc)
eprintf("usage: %s [-Rr] mode [file...]\n", argv[0]); eprintf("usage: %s [-r] mode [file...]\n", argv[0]);
parsemode(argv[optind++]); parsemode(argv[optind++]);
for(; optind < argc; optind++) for(; optind < argc; optind++)

View File

@ -3,7 +3,7 @@
chown \- change file ownership chown \- change file ownership
.SH SYNOPSIS .SH SYNOPSIS
.B chown .B chown
.RB [ \-Rr ] .RB [ \-r ]
.RI [ owner ][: group ] .RI [ owner ][: group ]
.RI [ file ...] .RI [ file ...]
.SH DESCRIPTION .SH DESCRIPTION
@ -11,7 +11,7 @@ chown \- change file ownership
changes the user or group ownership for the given files. changes the user or group ownership for the given files.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-R, \-r .B \-r
change directory ownership recursively. change directory ownership recursively.
.SH SEE ALSO .SH SEE ALSO
.IR chown (2) .IR chown (2)

View File

@ -19,9 +19,8 @@ main(int argc, char *argv[])
{ {
char c, *owner, *group; char c, *owner, *group;
while((c = getopt(argc, argv, "Rr")) != -1) while((c = getopt(argc, argv, "r")) != -1)
switch(c) { switch(c) {
case 'R':
case 'r': case 'r':
rflag = true; rflag = true;
break; break;
@ -29,7 +28,7 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if(optind == argc) if(optind == argc)
eprintf("usage: %s [-Rr] [owner][:group] [file...]\n", argv[0]); eprintf("usage: %s [-r] [owner][:group] [file...]\n", argv[0]);
owner = argv[optind++]; owner = argv[optind++];
if((group = strchr(owner, ':'))) if((group = strchr(owner, ':')))
*group++ = '\0'; *group++ = '\0';