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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Sat Sep 5 20:25:40 UTC 2009


Author: nekral-guest
Date: 2009-09-05 20:25:40 +0000 (Sat, 05 Sep 2009)
New Revision: 3056

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/gpasswd.c
   upstream/trunk/src/groupmems.c
Log:
	* src/gpasswd.c, src/groupmems.c: Split the groupmems and gpasswd
	Usage string. It was changed anyway to add the --help option.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-09-04 23:02:33 UTC (rev 3055)
+++ upstream/trunk/ChangeLog	2009-09-05 20:25:40 UTC (rev 3056)
@@ -1,3 +1,8 @@
+2009-09-05  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* src/gpasswd.c, src/groupmems.c: Split the groupmems and gpasswd
+	Usage string. It was changed anyway to add the --help option.
+
 2009-09-05  Mike Frysinger  <vapier at gentoo.org>
 
 	* NEWS, src/userdel.c, src/lastlog.c, src/gpasswd.c,

Modified: upstream/trunk/src/gpasswd.c
===================================================================
--- upstream/trunk/src/gpasswd.c	2009-09-04 23:02:33 UTC (rev 3055)
+++ upstream/trunk/src/gpasswd.c	2009-09-05 20:25:40 UTC (rev 3056)
@@ -130,27 +130,25 @@
  */
 static void usage (int status)
 {
-	fprintf (status ? stderr : stdout,
-	         _("Usage: %s [option] GROUP\n"
-	           "\n"
-	           "Options:\n"
-	           "  -a, --add USER                add USER to GROUP\n"
-	           "  -d, --delete USER             remove USER from GROUP\n"
-	           "  -h, --help                    display this help message and exit\n"
-	           "  -r, --remove-password         remove the GROUP's password\n"
-	           "  -R, --restrict                restrict access to GROUP to its members\n"
-	           "  -M, --members USER,...        set the list of members of GROUP\n"
-	           "%s\n"
-	           "\n"),
-	         Prog,
+	FILE *usageout = status ? stderr : stdout;
+	(void) fprintf (usageout,
+	                _("Usage: %s [option] GROUP\n"
+	                  "\n"
+	                  "Options:\n"),
+	                Prog);
+	(void) fputs (_("  -a, --add USER                add USER to GROUP\n"), usageout);
+	(void) fputs (_("  -d, --delete USER             remove USER from GROUP\n"), usageout);
+	(void) fputs (_("  -h, --help                    display this help message and exit\n"), usageout);
+	(void) fputs (_("  -r, --remove-password         remove the GROUP's password\n"), usageout);
+	(void) fputs (_("  -R, --restrict                restrict access to GROUP to its members\n"), usageout);
+	(void) fputs (_("  -M, --members USER,...        set the list of members of GROUP\n"), usageout);
 #ifdef SHADOWGRP
-	         _("  -A, --administrators ADMIN,...\n"
-	           "                                set the list of administrators for GROUP\n"
-	           "Except for the -A and -M options, the options cannot be combined.\n")
+	(void) fputs (_("  -A, --administrators ADMIN,...\n"
+	                "                                set the list of administrators for GROUP\n"), usageout);
+	(void) fputs (_("Except for the -A and -M options, the options cannot be combined.\n"), usageout);
 #else
-	         _("The options cannot be combined.\n")
+	(void) fputs (_("The options cannot be combined.\n"), usageout);
 #endif
-	        );
 	exit (status);
 }
 

Modified: upstream/trunk/src/groupmems.c
===================================================================
--- upstream/trunk/src/groupmems.c	2009-09-04 23:02:33 UTC (rev 3055)
+++ upstream/trunk/src/groupmems.c	2009-09-05 20:25:40 UTC (rev 3056)
@@ -2,7 +2,7 @@
  * Copyright (c) 2000       , International Business Machines
  *                            George Kraft IV, gk4 at us.ibm.com, 03/23/2000
  * Copyright (c) 2000 - 2006, Tomasz Kłoczko
- * Copyright (c) 2007 - 2008, Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -363,19 +363,21 @@
 
 static void usage (int status)
 {
-	(void) fputs (_("Usage: groupmems [options] [action]\n"
-	                "\n"
-	                "Options:\n"
-	                "  -g, --group groupname         change groupname instead of the user's group\n"
-	                "                                (root only)\n"
-	                "\n"
-	                "Actions:\n"
-	                "  -a, --add username            add username to the members of the group\n"
-	                "  -d, --delete username         remove username from the members of the group\n"
-	                "  -h, --help                    display this help message and exit\n"
-	                "  -p, --purge                   purge all members from the group\n"
-	                "  -l, --list                    list the members of the group\n"
-	                "\n"), status ? stderr : stdout);
+	FILE *usageout = status ? stderr : stdout;
+	(void) fprintf (usageout,
+	                _("Usage: %s [options] [action]\n"
+	                  "\n"
+	                  "Options:\n"),
+	                Prog);
+	(void) fputs (_("  -g, --group groupname         change groupname instead of the user's group\n"
+	                "                                (root only)\n"), usageout);
+	(void) fputs (_("\n"), usageout);
+	(void) fputs (_("Actions:\n"), usageout);
+	(void) fputs (_("  -a, --add username            add username to the members of the group\n"), usageout);
+	(void) fputs (_("  -d, --delete username         remove username from the members of the group\n"), usageout);
+	(void) fputs (_("  -h, --help                    display this help message and exit\n"), usageout);
+	(void) fputs (_("  -p, --purge                   purge all members from the group\n"), usageout);
+	(void) fputs (_("  -l, --list                    list the members of the group\n"), usageout);
 	fail_exit (status);
 }
 




More information about the Pkg-shadow-commits mailing list