+2009-04-11 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/usermod.c, src/useraddd.c: Fix the usage string so that it
+ does not change depending on the configure option. Use a format.
+
2009-04-11 Nicolas François <nicolas.francois@centraliens.net>
* src/gpasswd.c: Fix the usage of the unused macro.
rflg = false, /* create a system account */
sflg = false, /* shell program for new account */
uflg = false, /* specify user ID for new account */
- Uflg = false; /* create a group having the same name as the user */
+ Uflg = false, /* create a group having the same name as the user */
+ Zflg = false; /* new selinux user */
static bool home_added = false;
*/
static void usage (void)
{
- fputs (_("Usage: useradd [options] LOGIN\n"
+ fprintf (stderr,
+ _("Usage: useradd [options] LOGIN\n"
"\n"
"Options:\n"
" -b, --base-dir BASE_DIR base directory for the new user account\n"
" -s, --shell SHELL the login shell for the new user account\n"
" -u, --uid UID force use the UID for the new user account\n"
" -U, --user-group create a group with the same name as the user\n"
+ "%s"
+ "\n"),
#ifdef WITH_SELINUX
- " -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping\n"
+ _(" -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping\n")
+#else
+ ""
#endif
- "\n"), stderr);
+ );
exit (E_USAGE);
}
case 'Z':
if (is_selinux_enabled () > 0) {
user_selinux = optarg;
+ Zflg = true;
} else {
fprintf (stderr,
_("%s: -Z requires SELinux enabled kernel\n"),
*/
static void usage (void)
{
- fputs (_("Usage: usermod [options] LOGIN\n"
+ fprintf (stderr,
+ _("Usage: usermod [options] LOGIN\n"
"\n"
"Options:\n"
" -c, --comment COMMENT new value of the GECOS field\n"
" -s, --shell SHELL new login shell for the user account\n"
" -u, --uid UID new UID for the user account\n"
" -U, --unlock unlock the user account\n"
+ "%s"
+ "\n"),
#ifdef WITH_SELINUX
- " -Z, --selinux-user new SELinux user mapping for the user account\n"
+ _(" -Z, --selinux-user new SELinux user mapping for the user account\n")
+#else
+ ""
#endif
- "\n"), stderr);
+ );
exit (E_USAGE);
}