qdl: display version information

* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
This commit is contained in:
Nicolas Dechesne
2025-01-17 10:29:17 +01:00
committed by Bjorn Andersson
parent cc584d4560
commit e6469d9748

11
qdl.c
View File

@@ -103,7 +103,7 @@ static void print_usage(void)
{
extern const char *__progname;
fprintf(stderr,
"%s [--debug] [--allow-missing] [--storage <emmc|nand|ufs>] [--finalize-provisioning] [--include <PATH>] [--serial <NUM>] [--out-chunk-size <SIZE>] <prog.mbn> [<program> <patch> ...]\n",
"%s [--debug] [--version] [--allow-missing] [--storage <emmc|nand|ufs>] [--finalize-provisioning] [--include <PATH>] [--serial <NUM>] [--out-chunk-size <SIZE>] <prog.mbn> [<program> <patch> ...]\n",
__progname);
}
@@ -125,6 +125,7 @@ int main(int argc, char **argv)
static struct option options[] = {
{"debug", no_argument, 0, 'd'},
{"version", no_argument, 0, 'v'},
{"include", required_argument, 0, 'i'},
{"finalize-provisioning", no_argument, 0, 'l'},
{"out-chunk-size", required_argument, 0, OPT_OUT_CHUNK_SIZE },
@@ -134,11 +135,14 @@ int main(int argc, char **argv)
{0, 0, 0, 0}
};
while ((opt = getopt_long(argc, argv, "dfi:S:", options, NULL )) != -1) {
while ((opt = getopt_long(argc, argv, "dvfi:S:", options, NULL )) != -1) {
switch (opt) {
case 'd':
qdl_debug = true;
break;
case 'v':
print_version();
return 0;
case 'f':
allow_missing = true;
break;
@@ -172,6 +176,9 @@ int main(int argc, char **argv)
ux_init();
if (qdl_debug)
print_version();
prog_mbn = argv[optind++];
do {