[hackers] [sbase] chown: Update program usage and manpage || sin

From: <git_AT_suckless.org>
Date: Tue, 17 Feb 2015 18:33:39 +0100 (CET)

commit 551502540687744bb81fc3ff27062e3b0e840792
Author: sin <sin_AT_2f30.org>
Date: Tue Feb 17 16:41:58 2015 +0000

    chown: Update program usage and manpage

diff --git a/chown.1 b/chown.1
index 1365c07..7161cfe 100644
--- a/chown.1
+++ b/chown.1
_AT_@ -1,4 +1,4 @@
-.Dd January 30, 2015
+.Dd Feburary 17, 2015
 .Dt CHOWN 1
 .Os sbase
 .Sh NAME
_AT_@ -6,10 +6,11 @@
 .Nd change file ownership
 .Sh SYNOPSIS
 .Nm
-.Op Fl Rr
-.Op Fl H
-.Op Fl L
-.Op Fl P
+.Op Fl h
+.Oo
+.Fl R
+.Op Fl H | L | P
+.Oc
 .Op Ar owner Op Ar :group
 .Op Ar file ...
 .Sh DESCRIPTION
_AT_@ -18,9 +19,11 @@ changes the user or group ownership for the given
 .Ar files .
 .Sh OPTIONS
 .Bl -tag -width Ds
+.It Fl h
+Change the user ID and/or group ID of the symlink itself. This flag cannot be used
+with
+.Op Fl R .
 .It Fl R
-Equivalent to \-r.
-.It Fl r
 Change directory ownership recursively.
 .It Fl H
 Only dereference symbolic links that are passed as command line arguments when
_AT_@ -32,3 +35,9 @@ Don't dereference symbolic links (default).
 .El
 .Sh SEE ALSO
 .Xr chown 2
+.Sh STANDARDS
+The
+.Nm
+utility is compliant with the
+.St -p1003.1-2008
+specification.
diff --git a/chown.c b/chown.c
index 228d4a2..332cb62 100644
--- a/chown.c
+++ b/chown.c
_AT_@ -9,7 +9,7 @@
 #include "util.h"
 
 static int rflag = 0;
-static int fflag = 'P';
+static int HLPflag = 'P';
 static uid_t uid = -1;
 static gid_t gid = -1;
 static int ret = 0;
_AT_@ -17,20 +17,20 @@ static char *chown_f_name = "chown";
 static int (*chown_f)(const char *, uid_t, gid_t) = chown;
 
 static void
-chownpwgr(const char *path, int fflag)
+chownpwgr(const char *path, int HLPflag)
 {
         if (chown_f(path, uid, gid) < 0) {
                 weprintf("%s %s:", chown_f_name, path);
                 ret = 1;
         }
         if (rflag)
- recurse(path, chownpwgr, fflag);
+ recurse(path, chownpwgr, HLPflag);
 }
 
 static void
 usage(void)
 {
- eprintf("usage: %s [-hRr] [owner][:[group]] file...\n", argv0);
+ eprintf("usage: %s [-h] [-R [-H | -L | -P]] [owner][:[group]] file...\n", argv0);
 }
 
 int
_AT_@ -45,14 +45,14 @@ main(int argc, char *argv[])
                 chown_f_name = "lchown";
                 chown_f = lchown;
                 break;
- case 'R':
         case 'r':
+ case 'R':
                 rflag = 1;
                 break;
         case 'H':
         case 'L':
         case 'P':
- fflag = ARGC();
+ HLPflag = ARGC();
                 break;
         default:
                 usage();
_AT_@ -94,7 +94,7 @@ main(int argc, char *argv[])
                 }
         }
         for (; argc > 0; argc--, argv++)
- chownpwgr(argv[0], fflag);
+ chownpwgr(argv[0], HLPflag);
 
         return ret;
 }
Received on Tue Feb 17 2015 - 18:33:39 CET

This archive was generated by hypermail 2.3.0 : Tue Feb 17 2015 - 18:36:13 CET