mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
JsonConfig: more friendly error message
This commit is contained in:
+1
-1
@@ -622,7 +622,7 @@ static void run(FFdata* data)
|
||||
(error = ffOptionsParseLibraryJsonConfig(&instance.config.library, root)) ||
|
||||
false
|
||||
) {
|
||||
fputs(error, stderr);
|
||||
fprintf(stderr, "JsonConfig Error: %s\n", error);
|
||||
exit(477);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,6 +146,10 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
|
||||
options->noBuffer = yyjson_get_bool(val);
|
||||
else if (ffStrEqualsIgnCase(key, "keyWidth"))
|
||||
options->keyWidth = (uint32_t) yyjson_get_uint(val);
|
||||
else if (ffStrStartsWithIgnCase(key, "percent"))
|
||||
return "Property `display.percentX` has been changed to `display.percent.x`";
|
||||
else if (ffStrStartsWithIgnCase(key, "size"))
|
||||
return "Property `display.sizeX` has been changed to `display.size.x`";
|
||||
else
|
||||
return "Unknown display property";
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ const char* ffOptionsParseGeneralJsonConfig(FFOptionsGeneral* options, yyjson_va
|
||||
options->wmiTimeout = (int32_t) yyjson_get_int(val);
|
||||
#endif
|
||||
|
||||
else if (ffStrEqualsIgnCase(key, "stat"))
|
||||
return "Property `general.stat` has been changed to `display.stat`";
|
||||
else if (ffStrEqualsIgnCase(key, "pipe"))
|
||||
return "Property `general.pipe` has been changed to `display.pipe`";
|
||||
|
||||
else
|
||||
return "Unknown general property";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user