-t option does not require image file.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
} else {
if (optind == argc)
return errmsg("UBI device name was not specified (use -h for help)");
- else if (optind != argc - 2)
+ else if (optind != argc - 2 && !args.truncate)
return errmsg("specify UBI device name and image file name as first 2 "
"parameters (use -h for help)");
}
if (err)
return -1;
- if (!args.img && !args.truncate)
- return errmsg("incorrect arguments, use -h for help");
-
libubi = libubi_open(1);
if (libubi == NULL) {
sys_errmsg("cannot open libubi");