[Pkg-shadow-commits] r2468 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Mon Dec 22 22:06:28 UTC 2008


Author: nekral-guest
Date: 2008-12-22 22:06:27 +0000 (Mon, 22 Dec 2008)
New Revision: 2468

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/groupmod.c
Log:
	* src/groupmod.c: Re-indent.
	* src/groupmod.c: Do not add the command synopsis to the main ()
	documentation. This avoids outdated information.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-12-22 22:03:34 UTC (rev 2467)
+++ upstream/trunk/ChangeLog	2008-12-22 22:06:27 UTC (rev 2468)
@@ -1,6 +1,8 @@
 2008-12-22  Nicolas François  <nicolas.francois at centraliens.net>
 
-	* src/groupadd.c: Re-indent.
+	* src/groupadd.c, src/groupmod.c: Re-indent.
+	* src/groupmod.c: Do not add the command synopsis to the main ()
+	documentation. This avoids outdated information.
 
 2008-12-22  Nicolas François  <nicolas.francois at centraliens.net>
 

Modified: upstream/trunk/src/groupmod.c
===================================================================
--- upstream/trunk/src/groupmod.c	2008-12-22 22:03:34 UTC (rev 2467)
+++ upstream/trunk/src/groupmod.c	2008-12-22 22:06:27 UTC (rev 2468)
@@ -186,8 +186,8 @@
 	ogrp = gr_locate (group_name);
 	if (!ogrp) {
 		fprintf (stderr,
-			 _("%s: group '%s' does not exist in %s\n"),
-			 Prog, group_name, gr_dbname ());
+		         _("%s: group '%s' does not exist in %s\n"),
+		         Prog, group_name, gr_dbname ());
 		exit (E_GRP_UPDATE);
 	}
 	grp = *ogrp;
@@ -277,7 +277,8 @@
 	/*
 	 * Tell the user what they did wrong.
 	 */
-	fprintf (stderr, _("%s: GID '%lu' already exists\n"),
+	fprintf (stderr,
+	         _("%s: GID '%lu' already exists\n"),
 	         Prog, (unsigned long int) group_newid);
 	exit (E_GID_IN_USE);
 }
@@ -306,8 +307,8 @@
 		/* local, no need for xgetgrnam */
 		if (getgrnam (group_newname) != NULL) {
 			fprintf (stderr,
-				 _("%s: group '%s' already exists\n"), Prog,
-				 group_newname);
+			         _("%s: group '%s' already exists\n"),
+			         Prog, group_newname);
 			exit (E_NAME_IN_USE);
 		}
 		return;
@@ -317,8 +318,9 @@
 	 * All invalid group names land here.
 	 */
 
-	fprintf (stderr, _("%s: invalid group name '%s'\n"),
-		 Prog, group_newname);
+	fprintf (stderr,
+	         _("%s: invalid group name '%s'\n"),
+	         Prog, group_newname);
 	exit (E_BAD_ARG);
 }
 
@@ -332,8 +334,9 @@
 
 	val = strtol (gidstr, &errptr, 10); /* FIXME: Should be strtoul ? */
 	if (('\0' != *errptr) || (ERANGE == errno) || (val < 0)) {
-		fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog,
-			 gidstr);
+		fprintf (stderr,
+		         _("%s: invalid numeric argument '%s'\n"),
+		         Prog, gidstr);
 		exit (E_BAD_ARG);
 	}
 	return (gid_t) val;
@@ -348,40 +351,37 @@
  */
 static void process_flags (int argc, char **argv)
 {
-
-	{
-		int option_index = 0;
-		int c;
-		static struct option long_options[] = {
-			{"gid", required_argument, NULL, 'g'},
-			{"help", no_argument, NULL, 'h'},
-			{"new-name", required_argument, NULL, 'n'},
-			{"non-unique", no_argument, NULL, 'o'},
-			{"password", required_argument, NULL, 'p'},
-			{NULL, 0, NULL, '\0'}
-		};
-		while ((c =
-			getopt_long (argc, argv, "g:hn:op:",
-				     long_options, &option_index)) != -1) {
-			switch (c) {
-			case 'g':
-				gflg = true;
-				group_newid = get_gid (optarg);
-				break;
-			case 'n':
-				nflg = true;
-				group_newname = optarg;
-				break;
-			case 'o':
-				oflg = true;
-				break;
-			case 'p':
-				group_passwd = optarg;
-				pflg = true;
-				break;
-			default:
-				usage ();
-			}
+	int option_index = 0;
+	int c;
+	static struct option long_options[] = {
+		{"gid", required_argument, NULL, 'g'},
+		{"help", no_argument, NULL, 'h'},
+		{"new-name", required_argument, NULL, 'n'},
+		{"non-unique", no_argument, NULL, 'o'},
+		{"password", required_argument, NULL, 'p'},
+		{NULL, 0, NULL, '\0'}
+	};
+	while ((c =
+		getopt_long (argc, argv, "g:hn:op:",
+		             long_options, &option_index)) != -1) {
+		switch (c) {
+		case 'g':
+			gflg = true;
+			group_newid = get_gid (optarg);
+			break;
+		case 'n':
+			nflg = true;
+			group_newname = optarg;
+			break;
+		case 'o':
+			oflg = true;
+			break;
+		case 'p':
+			group_passwd = optarg;
+			pflg = true;
+			break;
+		default:
+			usage ();
 		}
 	}
 
@@ -676,14 +676,6 @@
 /*
  * main - groupmod command
  *
- *	The syntax of the groupmod command is
- *	
- *	groupmod [ -g gid [ -o ]] [ -n name ] group
- *
- *	The flags are
- *		-g - specify a new group ID value
- *		-o - permit the group ID value to be non-unique
- *		-n - specify a new group name
  */
 int main (int argc, char **argv)
 {
@@ -755,8 +747,9 @@
 		 */
 		grp = getgrnam (group_name); /* local, no need for xgetgrnam */
 		if (NULL == grp) {
-			fprintf (stderr, _("%s: group '%s' does not exist\n"),
-				 Prog, group_name);
+			fprintf (stderr,
+			         _("%s: group '%s' does not exist\n"),
+			         Prog, group_name);
 			exit (E_NOTFOUND);
 		} else {
 			group_id = grp->gr_gid;
@@ -771,13 +764,15 @@
 		char *nis_domain;
 		char *nis_master;
 
-		fprintf (stderr, _("%s: group %s is a NIS group\n"),
-			 Prog, group_name);
+		fprintf (stderr,
+		         _("%s: group %s is a NIS group\n"),
+		         Prog, group_name);
 
 		if (!yp_get_default_domain (&nis_domain) &&
 		    !yp_master (nis_domain, "group.byname", &nis_master)) {
-			fprintf (stderr, _("%s: %s is the NIS master\n"),
-				 Prog, nis_master);
+			fprintf (stderr,
+			         _("%s: %s is the NIS master\n"),
+			         Prog, nis_master);
 		}
 		exit (E_NOTFOUND);
 	}




More information about the Pkg-shadow-commits mailing list