+ if (log_level != 'V' && log_level != 'D') {
+ /*
+ * Legacy: do not override a previous
+ * --debug because --verbose and --debug
+ * can be specified together (in this
+ * case we want the lowest log level to
+ * apply, VERBOSE).
+ */
+ log_level = 'I';
+ }
+ } else if (strcmp(cur_arg, "--log-level") == 0 ||
+ strcmp(cur_arg, "-l") == 0) {
+ if (!next_arg) {
+ printf_err("Missing log level value for --log-level option\n");
+ *retcode = 1;
+ goto end;
+ }
+
+ log_level = log_level_from_arg(next_arg);
+ if (log_level == 'U') {
+ printf_err("Invalid argument for --log-level option:\n %s\n",
+ next_arg);
+ *retcode = 1;
+ goto end;
+ }
+
+ i++;
+ } else if (strncmp(cur_arg, "--log-level=", 12) == 0) {
+ const char *arg = &cur_arg[12];
+
+ log_level = log_level_from_arg(arg);
+ if (log_level == 'U') {
+ printf_err("Invalid argument for --log-level option:\n %s\n",
+ arg);
+ *retcode = 1;
+ goto end;
+ }
+ } else if (strncmp(cur_arg, "-l", 2) == 0) {
+ const char *arg = &cur_arg[2];
+
+ log_level = log_level_from_arg(arg);
+ if (log_level == 'U') {
+ printf_err("Invalid argument for --log-level option:\n %s\n",
+ arg);
+ *retcode = 1;
+ goto end;
+ }