feat: csv output header supports true/false options

This commit is contained in:
Yaming Pei 2025-03-03 15:37:08 +08:00
parent 2815227d25
commit 20f6c7dd53
1 changed files with 4 additions and 2 deletions

View File

@ -1620,11 +1620,13 @@ static int getMetaFromCommonJsonFile(tools_cJSON *json) {
}
// csv output header
g_arguments->csv_output_header = false;
g_arguments->csv_output_header = true;
tools_cJSON* oph = tools_cJSON_GetObjectItem(json, "csv_output_header");
if (oph && oph->type == tools_cJSON_String && oph->valuestring != NULL) {
if (0 == strcasecmp(oph->valuestring, "yes")) {
if (0 == strcasecmp(oph->valuestring, "yes") || 0 == strcasecmp(oph->valuestring, "true")) {
g_arguments->csv_output_header = true;
} else if (0 == strcasecmp(oph->valuestring, "no") || 0 == strcasecmp(oph->valuestring, "false")) {
g_arguments->csv_output_header = false;
}
}