Sort options as in man page.
This commit is contained in:
parent
d2ef0ab6f5
commit
674cf041a7
|
@ -91,12 +91,8 @@ main(int argc, char **argv)
|
|||
auth_type = AuthNone;
|
||||
mutual_auth = 0;
|
||||
|
||||
while ((i = getopt(argc, argv, "Va:d:h:l:n:t:u:")) != -1) {
|
||||
while ((i = getopt(argc, argv, "a:d:h:l:n:t:u:V")) != -1) {
|
||||
switch(i) {
|
||||
case 'V':
|
||||
(void) printf("\"%s\" %s\nPlease send all bug reports to %s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT);
|
||||
exit(EXIT_SUCCESS);
|
||||
/* NOTREACHED */
|
||||
case 'a':
|
||||
if (strcasecmp(optarg, "chap") == 0) {
|
||||
auth_type = AuthCHAP;
|
||||
|
@ -130,6 +126,10 @@ main(int argc, char **argv)
|
|||
case 'u':
|
||||
user = optarg;
|
||||
break;
|
||||
case 'V':
|
||||
(void) printf("\"%s\" %s\nPlease send all bug reports to %s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT);
|
||||
exit(EXIT_SUCCESS);
|
||||
/* NOTREACHED */
|
||||
default:
|
||||
(void) fprintf(stderr, "%s: unknown option `%c'", *argv, i);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: iscsi-target.c,v 1.6 2006/03/05 23:50:46 agc Exp $ */
|
||||
/* $NetBSD: iscsi-target.c,v 1.7 2006/03/11 11:58:22 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright © 2006 Alistair Crooks. All rights reserved.
|
||||
|
@ -85,15 +85,8 @@ main(int argc, char **argv)
|
|||
|
||||
cf = _PATH_ISCSI_TARGETS;
|
||||
|
||||
while ((i = getopt(argc, argv, "DV46b:f:p:t:v:")) != -1) {
|
||||
while ((i = getopt(argc, argv, "46b:Df:p:t:Vv:")) != -1) {
|
||||
switch (i) {
|
||||
case 'D':
|
||||
detach_me_harder = 0;
|
||||
break;
|
||||
case 'V':
|
||||
(void) printf("\"%s\" %s\nPlease send all bug reports to %s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT);
|
||||
exit(EXIT_SUCCESS);
|
||||
/* NOTREACHED */
|
||||
case '4':
|
||||
g.address_family = ISCSI_IPv4;
|
||||
break;
|
||||
|
@ -103,6 +96,9 @@ main(int argc, char **argv)
|
|||
case 'b':
|
||||
device_set_var("blocklen", optarg);
|
||||
break;
|
||||
case 'D':
|
||||
detach_me_harder = 0;
|
||||
break;
|
||||
case 'f':
|
||||
cf = optarg;
|
||||
break;
|
||||
|
@ -112,6 +108,10 @@ main(int argc, char **argv)
|
|||
case 't':
|
||||
(void) strlcpy(TargetName, optarg, sizeof(TargetName));
|
||||
break;
|
||||
case 'V':
|
||||
(void) printf("\"%s\" %s\nPlease send all bug reports to %s\n", PACKAGE_NAME, PACKAGE_VERSION, PACKAGE_BUGREPORT);
|
||||
exit(EXIT_SUCCESS);
|
||||
/* NOTREACHED */
|
||||
case 'v':
|
||||
if (strcmp(optarg, "net") == 0) {
|
||||
set_debug("net");
|
||||
|
|
Loading…
Reference in New Issue