iscsi-inq: handle setting of debug_level correctly
According to the man page and help info, --debug=integer can specify the debug_level, while it would report following error: iscsi-inq --debug=2 iscsi-inq: option '--debug' doesn't allow an argument It's because the iscsi-inq code did not handle this parameters correctly. So here we just correct it. Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
This commit is contained in:
@@ -241,7 +241,7 @@ int main(int argc, char *argv[])
|
|||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"usage", no_argument, NULL, 'u'},
|
{"usage", no_argument, NULL, 'u'},
|
||||||
{"debug", no_argument, NULL, 'd'},
|
{"debug", required_argument, NULL, 'd'},
|
||||||
{"initiator-name", required_argument, NULL, 'i'},
|
{"initiator-name", required_argument, NULL, 'i'},
|
||||||
{"evpd", required_argument, NULL, 'e'},
|
{"evpd", required_argument, NULL, 'e'},
|
||||||
{"pagecode", required_argument, NULL, 'c'},
|
{"pagecode", required_argument, NULL, 'c'},
|
||||||
@@ -249,7 +249,7 @@ int main(int argc, char *argv[])
|
|||||||
};
|
};
|
||||||
int option_index;
|
int option_index;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "h?udi:e:c:", long_options,
|
while ((c = getopt_long(argc, argv, "h?ud:i:e:c:", long_options,
|
||||||
&option_index)) != -1) {
|
&option_index)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
@@ -260,7 +260,7 @@ int main(int argc, char *argv[])
|
|||||||
show_usage = 1;
|
show_usage = 1;
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
debug = 1;
|
debug = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
initiator = optarg;
|
initiator = optarg;
|
||||||
|
|||||||
Reference in New Issue
Block a user