From: nekral-guest Date: Sat, 5 Sep 2009 20:25:40 +0000 (+0000) Subject: * src/gpasswd.c, src/groupmems.c: Split the groupmems and gpasswd X-Git-Tag: 4.1.5~390 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32e2ef34a3c52e80080a6a549a3cd0e5586f7b9e;p=shadow * src/gpasswd.c, src/groupmems.c: Split the groupmems and gpasswd Usage string. It was changed anyway to add the --help option. --- diff --git a/ChangeLog b/ChangeLog index 78fa9060..0910d8d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-05 Nicolas François + + * 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 * NEWS, src/userdel.c, src/lastlog.c, src/gpasswd.c, diff --git a/src/gpasswd.c b/src/gpasswd.c index 7a35f136..d3682bd2 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -130,27 +130,25 @@ static void log_gpasswd_success_gshadow (unused void *arg); */ 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); } diff --git a/src/groupmems.c b/src/groupmems.c index 058060d9..91e89a5d 100644 --- a/src/groupmems.c +++ b/src/groupmems.c @@ -2,7 +2,7 @@ * Copyright (c) 2000 , International Business Machines * George Kraft IV, gk4@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 display_members (const char *const *members) 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); }