|
@@ -281,15 +281,17 @@ static int img_create(int argc, char **argv)
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if (optind >= argc)
|
|
|
- help();
|
|
|
- filename = argv[optind++];
|
|
|
|
|
|
/* Find driver and parse its options */
|
|
|
drv = bdrv_find_format(fmt);
|
|
|
if (!drv)
|
|
|
error("Unknown file format '%s'", fmt);
|
|
|
|
|
|
+ if (options && !strcmp(options, "?")) {
|
|
|
+ print_option_help(drv->create_options);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
if (options) {
|
|
|
param = parse_option_parameters(options, drv->create_options, param);
|
|
|
if (param == NULL) {
|
|
@@ -299,6 +301,11 @@ static int img_create(int argc, char **argv)
|
|
|
param = parse_option_parameters("", drv->create_options, param);
|
|
|
}
|
|
|
|
|
|
+ /* Get the filename */
|
|
|
+ if (optind >= argc)
|
|
|
+ help();
|
|
|
+ filename = argv[optind++];
|
|
|
+
|
|
|
/* Add size to parameters */
|
|
|
if (optind < argc) {
|
|
|
set_option_parameter(param, BLOCK_OPT_SIZE, argv[optind++]);
|
|
@@ -596,6 +603,11 @@ static int img_convert(int argc, char **argv)
|
|
|
if (!drv)
|
|
|
error("Unknown file format '%s'", out_fmt);
|
|
|
|
|
|
+ if (options && !strcmp(options, "?")) {
|
|
|
+ print_option_help(drv->create_options);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
if (options) {
|
|
|
param = parse_option_parameters(options, drv->create_options, param);
|
|
|
if (param == NULL) {
|