mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
+16
-1
@@ -218,7 +218,7 @@ void ffPrintDisk(FFDiskOptions* options)
|
||||
|
||||
void ffInitDiskOptions(FFDiskOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DISK_MODULE_NAME, ffParseDiskCommandOptions, ffParseDiskJsonObject, ffPrintDisk, ffGenerateDiskJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DISK_MODULE_NAME, ffParseDiskCommandOptions, ffParseDiskJsonObject, ffPrintDisk, ffGenerateDiskJson, ffPrintDiskHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
|
||||
ffStrbufInit(&options->folders);
|
||||
@@ -452,3 +452,18 @@ void ffGenerateDiskJson(FFDiskOptions* options, yyjson_mut_doc* doc, yyjson_mut_
|
||||
ffStrbufDestroy(&item->name);
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintDiskHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_DISK_MODULE_NAME, "{1} / {2} ({3}) - {9}", FF_DISK_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Size used",
|
||||
"Size total",
|
||||
"Size percentage",
|
||||
"Files used",
|
||||
"Files total",
|
||||
"Files percentage",
|
||||
"True if external volume",
|
||||
"True if hidden volume",
|
||||
"Filesystem"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseDiskCommandOptions(FFDiskOptions* options, const char* key, const ch
|
||||
void ffDestroyDiskOptions(FFDiskOptions* options);
|
||||
void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module);
|
||||
void ffGenerateDiskJson(FFDiskOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintDiskHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user