USERNAME / PASSWORD

When failing iscsi-ls due to a missing url, print the url syntax
in the error message before aborting
This commit is contained in:
Ronnie Sahlberg
2010-12-25 12:04:29 +11:00
parent 60718652a4
commit 240e250b11
2 changed files with 7 additions and 2 deletions

View File

@@ -192,9 +192,14 @@ int main(int argc, const char *argv[])
exit(10);
}
if (url == NULL) {
fprintf(stderr, "You must specify the URL\n");
fprintf(stderr, " iscsi://[<username>[%%<password>]@]<host>[:<port>]/<target-iqn>/<lun>\n");
exit(10);
}
iscsi_url = iscsi_parse_full_url(iscsi, url);
if (iscsi_url == NULL) {
fprintf(stderr, "Failed to parse URL : %s\n", url);
fprintf(stderr, "Failed to parse URL : %s %s\n", url, iscsi_get_error(iscsi));
exit(10);
}