Disk: add missing JSON config options

This commit is contained in:
李通洲 committed 2025-08-03 10:22:32 +08:00
1 parent 59289bef6c
commit 4a141c3f57
2 files changed
+17

No files matched your search

+5
View File
@@ -2100,6 +2100,11 @@
"type": "string",
"description": "A colon separated file systems to hide from the disk output"
},
"showRegular": {
"type": "boolean",
"description": "Set if regular volume should be printed",
"default": true
},
"showExternal": {
"type": "boolean",
"description": "Set if external volume should be printed",
+12
View File
@@ -324,6 +324,15 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module)
continue;
}
if (unsafe_yyjson_equals_str(key, "showRegular"))
{
if (yyjson_get_bool(val))
options->showTypes |= FF_DISK_VOLUME_TYPE_REGULAR_BIT;
else
options->showTypes &= ~FF_DISK_VOLUME_TYPE_REGULAR_BIT;
continue;
}
if (unsafe_yyjson_equals_str(key, "showExternal"))
{
if (yyjson_get_bool(val))
@@ -394,6 +403,9 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso
if (defaultOptions.showTypes != options->showTypes)
{
if (options->showTypes & FF_DISK_VOLUME_TYPE_REGULAR_BIT)
yyjson_mut_obj_add_bool(doc, module, "showRegular", true);
if (options->showTypes & FF_DISK_VOLUME_TYPE_EXTERNAL_BIT)
yyjson_mut_obj_add_bool(doc, module, "showExternal", true);