mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Disk: rename hiddenFolder to hideFolder; add docs
This commit is contained in:
@@ -1754,6 +1754,10 @@
|
||||
"type": "string",
|
||||
"description": "A colon (semicolon on Windows) separated list of folder paths for the disk output\nDefault: auto detection using mount-points\nThis option overrides other `show*` options"
|
||||
},
|
||||
"hideFolders": {
|
||||
"type": "string",
|
||||
"description": "A colon (semicolon on Windows) separated list of folder paths to hide from the disk output\nDefault: /efi:/boot:/boot/efi"
|
||||
},
|
||||
"showExternal": {
|
||||
"type": "boolean",
|
||||
"description": "Set if external volume should be printed",
|
||||
|
||||
@@ -840,6 +840,14 @@
|
||||
"default": "Auto detection using mount-points"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "disk-hide-folders",
|
||||
"desc": "A colon (semicolon on Windows) separated list of folder paths to hide from the disk output",
|
||||
"arg": {
|
||||
"type": "path",
|
||||
"default": "Auto detection using mount-points"
|
||||
}
|
||||
},
|
||||
{
|
||||
"long": "disk-show-regular",
|
||||
"desc": "Specify whether regular volumes should be displayed",
|
||||
|
||||
@@ -54,11 +54,11 @@ const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks)
|
||||
}
|
||||
}
|
||||
|
||||
if (options->hiddenFolders.length)
|
||||
if (options->hideFolders.length)
|
||||
{
|
||||
FF_LIST_FOR_EACH(FFDisk, disk, *disks)
|
||||
{
|
||||
if (ffDiskMatchMountpoint(&options->hiddenFolders, disk->mountpoint.chars))
|
||||
if (ffDiskMatchMountpoint(&options->hideFolders, disk->mountpoint.chars))
|
||||
disk->type |= FF_DISK_VOLUME_TYPE_HIDDEN_BIT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,9 +205,9 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ffStrEqualsIgnCase(subKey, "hidden-folders"))
|
||||
if (ffStrEqualsIgnCase(subKey, "hide-folders"))
|
||||
{
|
||||
ffOptionParseString(key, value, &options->hiddenFolders);
|
||||
ffOptionParseString(key, value, &options->hideFolders);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -299,9 +299,9 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ffStrEqualsIgnCase(key, "hiddenFolders"))
|
||||
if (ffStrEqualsIgnCase(key, "hideFolders"))
|
||||
{
|
||||
ffStrbufSetS(&options->hiddenFolders, yyjson_get_str(val));
|
||||
ffStrbufSetS(&options->hideFolders, yyjson_get_str(val));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -394,8 +394,8 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso
|
||||
if (!ffStrbufEqual(&options->folders, &defaultOptions.folders))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "folders", &options->folders);
|
||||
|
||||
if (!ffStrbufEqual(&options->hiddenFolders, &defaultOptions.hiddenFolders))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "hiddenFolders", &options->hiddenFolders);
|
||||
if (!ffStrbufEqual(&options->hideFolders, &defaultOptions.hideFolders))
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "hideFolders", &options->hideFolders);
|
||||
|
||||
if (defaultOptions.calcType != options->calcType)
|
||||
yyjson_mut_obj_add_bool(doc, module, "useAvailable", options->calcType == FF_DISK_CALC_TYPE_AVAILABLE);
|
||||
@@ -512,9 +512,9 @@ void ffInitDiskOptions(FFDiskOptions* options)
|
||||
|
||||
ffStrbufInit(&options->folders);
|
||||
#if _WIN32 || __APPLE__ || __ANDROID__
|
||||
ffStrbufInit(&options->hiddenFolders);
|
||||
ffStrbufInit(&options->hideFolders);
|
||||
#else
|
||||
ffStrbufInitStatic(&options->hiddenFolders, "/efi:/boot:/boot/efi");
|
||||
ffStrbufInitStatic(&options->hideFolders, "/efi:/boot:/boot/efi");
|
||||
#endif
|
||||
options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT;
|
||||
options->calcType = FF_DISK_CALC_TYPE_FREE;
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct FFDiskOptions
|
||||
FFModuleArgs moduleArgs;
|
||||
|
||||
FFstrbuf folders;
|
||||
FFstrbuf hiddenFolders;
|
||||
FFstrbuf hideFolders;
|
||||
FFDiskVolumeType showTypes;
|
||||
FFDiskCalcType calcType;
|
||||
FFPercentageModuleConfig percent;
|
||||
|
||||
Reference in New Issue
Block a user