* 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:
parent
7d8ca29bea
commit
f0a63185c9
@ -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>
|
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:
|
* NEWS, src/pwck.c, man/pwck.8.xm, src/grpck.c, man/grpck.8.xml:
|
||||||
|
@ -150,12 +150,12 @@ static void process_flags (int argc, char **argv)
|
|||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"crypt-method", required_argument, NULL, 'c'},
|
{"crypt-method", required_argument, NULL, 'c'},
|
||||||
{"encrypted", no_argument, NULL, 'e'},
|
{"encrypted", no_argument, NULL, 'e'},
|
||||||
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"md5", no_argument, NULL, 'm'},
|
{"md5", no_argument, NULL, 'm'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
#ifdef USE_SHA_CRYPT
|
#ifdef USE_SHA_CRYPT
|
||||||
{"sha-rounds", required_argument, NULL, 's'},
|
{"sha-rounds", required_argument, NULL, 's'},
|
||||||
#endif /* USE_SHA_CRYPT */
|
#endif /* USE_SHA_CRYPT */
|
||||||
{"help", no_argument, NULL, 'h'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -167,15 +167,15 @@ static void process_flags (int argc, char **argv)
|
|||||||
#endif /* !USE_SHA_CRYPT */
|
#endif /* !USE_SHA_CRYPT */
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
|
||||||
usage (E_SUCCESS);
|
|
||||||
/*@notreached@*/break;
|
|
||||||
case 'c':
|
case 'c':
|
||||||
crypt_method = optarg;
|
crypt_method = optarg;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
eflg = true;
|
eflg = true;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
usage (E_SUCCESS);
|
||||||
|
/*@notreached@*/break;
|
||||||
case 'm':
|
case 'm':
|
||||||
md5flg = true;
|
md5flg = true;
|
||||||
break;
|
break;
|
||||||
|
@ -230,13 +230,13 @@ static void process_flags (int argc, char **argv)
|
|||||||
int c;
|
int c;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"add", required_argument, NULL, 'a'},
|
{"add", required_argument, NULL, 'a'},
|
||||||
|
{"administrators", required_argument, NULL, 'A'},
|
||||||
{"delete", required_argument, NULL, 'd'},
|
{"delete", required_argument, NULL, 'd'},
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"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'},
|
{"members", required_argument, NULL, 'M'},
|
||||||
{"root", required_argument, NULL, 'Q'},
|
{"root", required_argument, NULL, 'Q'},
|
||||||
|
{"remove-password", no_argument, NULL, 'r'},
|
||||||
|
{"restrict", no_argument, NULL, 'R'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -211,33 +211,17 @@ int main (int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static struct option const longopts[] = {
|
static struct option const longopts[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
|
||||||
{"time", required_argument, NULL, 't'},
|
|
||||||
{"before", required_argument, NULL, 'b'},
|
{"before", required_argument, NULL, 'b'},
|
||||||
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
|
{"time", required_argument, NULL, 't'},
|
||||||
{"user", required_argument, NULL, 'u'},
|
{"user", required_argument, NULL, 'u'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{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) {
|
NULL)) != -1) {
|
||||||
switch (c) {
|
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':
|
case 'b':
|
||||||
{
|
{
|
||||||
unsigned long inverse_days;
|
unsigned long inverse_days;
|
||||||
@ -251,8 +235,24 @@ int main (int argc, char **argv)
|
|||||||
bflg = true;
|
bflg = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'h':
|
||||||
|
usage (EXIT_SUCCESS);
|
||||||
|
/*@notreached@*/break;
|
||||||
case 'R': /* no-op, handled in process_root_flag () */
|
case 'R': /* no-op, handled in process_root_flag () */
|
||||||
break;
|
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':
|
case 'u':
|
||||||
{
|
{
|
||||||
const struct passwd *pwent;
|
const struct passwd *pwent;
|
||||||
|
@ -527,12 +527,14 @@ static void process_flags (int argc, char **argv)
|
|||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
#ifndef USE_PAM
|
#ifndef USE_PAM
|
||||||
{"crypt-method", required_argument, NULL, 'c'},
|
{"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
|
#ifdef USE_SHA_CRYPT
|
||||||
{"sha-rounds", required_argument, NULL, 's'},
|
{"sha-rounds", required_argument, NULL, 's'},
|
||||||
#endif /* USE_SHA_CRYPT */
|
#endif /* USE_SHA_CRYPT */
|
||||||
#endif /* !USE_PAM */
|
#endif /* !USE_PAM */
|
||||||
{"help", no_argument, NULL, 'h'},
|
|
||||||
{"system", no_argument, NULL, 'r'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -548,6 +550,11 @@ static void process_flags (int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
#ifndef USE_PAM
|
||||||
|
case 'c':
|
||||||
|
crypt_method = optarg;
|
||||||
|
break;
|
||||||
|
#endif /* !USE_PAM */
|
||||||
case 'h':
|
case 'h':
|
||||||
usage (EXIT_SUCCESS);
|
usage (EXIT_SUCCESS);
|
||||||
break;
|
break;
|
||||||
@ -555,9 +562,6 @@ static void process_flags (int argc, char **argv)
|
|||||||
rflg = true;
|
rflg = true;
|
||||||
break;
|
break;
|
||||||
#ifndef USE_PAM
|
#ifndef USE_PAM
|
||||||
case 'c':
|
|
||||||
crypt_method = optarg;
|
|
||||||
break;
|
|
||||||
#ifdef USE_SHA_CRYPT
|
#ifdef USE_SHA_CRYPT
|
||||||
case 's':
|
case 's':
|
||||||
sflg = true;
|
sflg = true;
|
||||||
|
@ -834,6 +834,9 @@ int main (int argc, char **argv)
|
|||||||
eflg = true;
|
eflg = true;
|
||||||
anyflag = true;
|
anyflag = true;
|
||||||
break;
|
break;
|
||||||
|
case 'h':
|
||||||
|
usage (E_SUCCESS);
|
||||||
|
/*@notreached@*/break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if ( (getlong (optarg, &inact) == 0)
|
if ( (getlong (optarg, &inact) == 0)
|
||||||
|| (inact < -1)) {
|
|| (inact < -1)) {
|
||||||
@ -908,9 +911,6 @@ int main (int argc, char **argv)
|
|||||||
xflg = true;
|
xflg = true;
|
||||||
anyflag = true;
|
anyflag = true;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
|
||||||
usage (E_SUCCESS);
|
|
||||||
/*@notreached@*/break;
|
|
||||||
default:
|
default:
|
||||||
usage (E_BAD_ARG);
|
usage (E_BAD_ARG);
|
||||||
}
|
}
|
||||||
|
@ -991,20 +991,20 @@ static void process_flags (int argc, char **argv)
|
|||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"skel", required_argument, NULL, 'k'},
|
{"skel", required_argument, NULL, 'k'},
|
||||||
{"key", required_argument, NULL, 'K'},
|
{"key", required_argument, NULL, 'K'},
|
||||||
|
{"no-log-init", no_argument, NULL, 'l'},
|
||||||
{"create-home", no_argument, NULL, 'm'},
|
{"create-home", no_argument, NULL, 'm'},
|
||||||
{"no-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'},
|
{"no-user-group", no_argument, NULL, 'N'},
|
||||||
{"non-unique", no_argument, NULL, 'o'},
|
{"non-unique", no_argument, NULL, 'o'},
|
||||||
{"password", required_argument, NULL, 'p'},
|
{"password", required_argument, NULL, 'p'},
|
||||||
{"system", no_argument, NULL, 'r'},
|
{"system", no_argument, NULL, 'r'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
{"shell", required_argument, NULL, 's'},
|
{"shell", required_argument, NULL, 's'},
|
||||||
|
{"uid", required_argument, NULL, 'u'},
|
||||||
|
{"user-group", no_argument, NULL, 'U'},
|
||||||
#ifdef WITH_SELINUX
|
#ifdef WITH_SELINUX
|
||||||
{"selinux-user", required_argument, NULL, 'Z'},
|
{"selinux-user", required_argument, NULL, 'Z'},
|
||||||
#endif
|
#endif
|
||||||
{"uid", required_argument, NULL, 'u'},
|
|
||||||
{"user-group", no_argument, NULL, 'U'},
|
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv,
|
while ((c = getopt_long (argc, argv,
|
||||||
|
@ -889,12 +889,12 @@ static void process_flags (int argc, char **argv)
|
|||||||
{"non-unique", no_argument, NULL, 'o'},
|
{"non-unique", no_argument, NULL, 'o'},
|
||||||
{"password", required_argument, NULL, 'p'},
|
{"password", required_argument, NULL, 'p'},
|
||||||
{"root", required_argument, NULL, 'R'},
|
{"root", required_argument, NULL, 'R'},
|
||||||
#ifdef WITH_SELINUX
|
|
||||||
{"selinux-user", required_argument, NULL, 'Z'},
|
|
||||||
#endif
|
|
||||||
{"shell", required_argument, NULL, 's'},
|
{"shell", required_argument, NULL, 's'},
|
||||||
{"uid", required_argument, NULL, 'u'},
|
{"uid", required_argument, NULL, 'u'},
|
||||||
{"unlock", no_argument, NULL, 'U'},
|
{"unlock", no_argument, NULL, 'U'},
|
||||||
|
#ifdef WITH_SELINUX
|
||||||
|
{"selinux-user", required_argument, NULL, 'Z'},
|
||||||
|
#endif
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
while ((c = getopt_long (argc, argv,
|
while ((c = getopt_long (argc, argv,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user