* src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,

src/faillog.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c,
	src/groupmems.c, src/groupmod.c, src/grpconv.c, src/grpunconv.c,
	src/lastlog.c, src/newusers.c, src/passwd.c, src/pwconv.c,
	src/pwunconv.c, src/su.c, src/useradd.c, src/userdel.c,
	src/usermod.c, src/vipw.c: Align and sort options.
This commit is contained in:
nekral-guest 2011-11-06 18:39:59 +00:00
parent 7d8ca29bea
commit f0a63185c9
23 changed files with 177 additions and 164 deletions

View File

@ -1,3 +1,12 @@
2011-10-31 Nicolas François <nicolas.francois@centraliens.net>
* src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,
src/faillog.c, src/gpasswd.c, src/groupadd.c, src/groupdel.c,
src/groupmems.c, src/groupmod.c, src/grpconv.c, src/grpunconv.c,
src/lastlog.c, src/newusers.c, src/passwd.c, src/pwconv.c,
src/pwunconv.c, src/su.c, src/useradd.c, src/userdel.c,
src/usermod.c, src/vipw.c: Align and sort options.
2011-10-31 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/pwck.c, man/pwck.8.xm, src/grpck.c, man/grpck.8.xml:

View File

@ -150,12 +150,12 @@ static void process_flags (int argc, char **argv)
static struct option long_options[] = {
{"crypt-method", required_argument, NULL, 'c'},
{"encrypted", no_argument, NULL, 'e'},
{"help", no_argument, NULL, 'h'},
{"md5", no_argument, NULL, 'm'},
{"root", required_argument, NULL, 'R'},
#ifdef USE_SHA_CRYPT
{"sha-rounds", required_argument, NULL, 's'},
#endif /* USE_SHA_CRYPT */
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, '\0'}
};
@ -167,15 +167,15 @@ static void process_flags (int argc, char **argv)
#endif /* !USE_SHA_CRYPT */
long_options, NULL)) != -1) {
switch (c) {
case 'h':
usage (E_SUCCESS);
/*@notreached@*/break;
case 'c':
crypt_method = optarg;
break;
case 'e':
eflg = true;
break;
case 'h':
usage (E_SUCCESS);
/*@notreached@*/break;
case 'm':
md5flg = true;
break;

View File

@ -230,13 +230,13 @@ static void process_flags (int argc, char **argv)
int c;
static struct option long_options[] = {
{"add", required_argument, NULL, 'a'},
{"administrators", required_argument, NULL, 'A'},
{"delete", required_argument, NULL, 'd'},
{"help", no_argument, NULL, 'h'},
{"remove-password", no_argument, NULL, 'r'},
{"restrict", no_argument, NULL, 'R'},
{"administrators", required_argument, NULL, 'A'},
{"members", required_argument, NULL, 'M'},
{"root", required_argument, NULL, 'Q'},
{"remove-password", no_argument, NULL, 'r'},
{"restrict", no_argument, NULL, 'R'},
{NULL, 0, NULL, '\0'}
};

View File

@ -211,33 +211,17 @@ int main (int argc, char **argv)
{
int c;
static struct option const longopts[] = {
{"help", no_argument, NULL, 'h'},
{"time", required_argument, NULL, 't'},
{"before", required_argument, NULL, 'b'},
{"help", no_argument, NULL, 'h'},
{"root", required_argument, NULL, 'R'},
{"time", required_argument, NULL, 't'},
{"user", required_argument, NULL, 'u'},
{NULL, 0, NULL, '\0'}
};
while ((c = getopt_long (argc, argv, "ht:b:R:u:", longopts,
while ((c = getopt_long (argc, argv, "b:hR:t:u:", longopts,
NULL)) != -1) {
switch (c) {
case 'h':
usage (EXIT_SUCCESS);
/*@notreached@*/break;
case 't':
{
unsigned long days;
if (getulong (optarg, &days) == 0) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
exit (EXIT_FAILURE);
}
seconds = (time_t) days * DAY;
tflg = true;
break;
}
case 'b':
{
unsigned long inverse_days;
@ -251,8 +235,24 @@ int main (int argc, char **argv)
bflg = true;
break;
}
case 'h':
usage (EXIT_SUCCESS);
/*@notreached@*/break;
case 'R': /* no-op, handled in process_root_flag () */
break;
case 't':
{
unsigned long days;
if (getulong (optarg, &days) == 0) {
fprintf (stderr,
_("%s: invalid numeric argument '%s'\n"),
Prog, optarg);
exit (EXIT_FAILURE);
}
seconds = (time_t) days * DAY;
tflg = true;
break;
}
case 'u':
{
const struct passwd *pwent;

View File

@ -527,12 +527,14 @@ static void process_flags (int argc, char **argv)
static struct option long_options[] = {
#ifndef USE_PAM
{"crypt-method", required_argument, NULL, 'c'},
#endif /* !USE_PAM */
{"help", no_argument, NULL, 'h'},
{"system", no_argument, NULL, 'r'},
#ifndef USE_PAM
#ifdef USE_SHA_CRYPT
{"sha-rounds", required_argument, NULL, 's'},
#endif /* USE_SHA_CRYPT */
#endif /* !USE_PAM */
{"help", no_argument, NULL, 'h'},
{"system", no_argument, NULL, 'r'},
{NULL, 0, NULL, '\0'}
};
@ -548,6 +550,11 @@ static void process_flags (int argc, char **argv)
#endif
long_options, NULL)) != -1) {
switch (c) {
#ifndef USE_PAM
case 'c':
crypt_method = optarg;
break;
#endif /* !USE_PAM */
case 'h':
usage (EXIT_SUCCESS);
break;
@ -555,9 +562,6 @@ static void process_flags (int argc, char **argv)
rflg = true;
break;
#ifndef USE_PAM
case 'c':
crypt_method = optarg;
break;
#ifdef USE_SHA_CRYPT
case 's':
sflg = true;

View File

@ -834,6 +834,9 @@ int main (int argc, char **argv)
eflg = true;
anyflag = true;
break;
case 'h':
usage (E_SUCCESS);
/*@notreached@*/break;
case 'i':
if ( (getlong (optarg, &inact) == 0)
|| (inact < -1)) {
@ -908,9 +911,6 @@ int main (int argc, char **argv)
xflg = true;
anyflag = true;
break;
case 'h':
usage (E_SUCCESS);
/*@notreached@*/break;
default:
usage (E_BAD_ARG);
}

View File

@ -991,20 +991,20 @@ static void process_flags (int argc, char **argv)
{"help", no_argument, NULL, 'h'},
{"skel", required_argument, NULL, 'k'},
{"key", required_argument, NULL, 'K'},
{"no-log-init", no_argument, NULL, 'l'},
{"create-home", no_argument, NULL, 'm'},
{"no-create-home", no_argument, NULL, 'M'},
{"no-log-init", no_argument, NULL, 'l'},
{"no-user-group", no_argument, NULL, 'N'},
{"non-unique", no_argument, NULL, 'o'},
{"password", required_argument, NULL, 'p'},
{"system", no_argument, NULL, 'r'},
{"root", required_argument, NULL, 'R'},
{"shell", required_argument, NULL, 's'},
{"uid", required_argument, NULL, 'u'},
{"user-group", no_argument, NULL, 'U'},
#ifdef WITH_SELINUX
{"selinux-user", required_argument, NULL, 'Z'},
#endif
{"uid", required_argument, NULL, 'u'},
{"user-group", no_argument, NULL, 'U'},
{NULL, 0, NULL, '\0'}
};
while ((c = getopt_long (argc, argv,

View File

@ -889,12 +889,12 @@ static void process_flags (int argc, char **argv)
{"non-unique", no_argument, NULL, 'o'},
{"password", required_argument, NULL, 'p'},
{"root", required_argument, NULL, 'R'},
#ifdef WITH_SELINUX
{"selinux-user", required_argument, NULL, 'Z'},
#endif
{"shell", required_argument, NULL, 's'},
{"uid", required_argument, NULL, 'u'},
{"unlock", no_argument, NULL, 'U'},
#ifdef WITH_SELINUX
{"selinux-user", required_argument, NULL, 'Z'},
#endif
{NULL, 0, NULL, '\0'}
};
while ((c = getopt_long (argc, argv,