mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-06 13:14:21 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
+10
-1
@@ -75,7 +75,7 @@ void ffPrintSwap(FFSwapOptions* options)
|
||||
|
||||
void ffInitSwapOptions(FFSwapOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_SWAP_MODULE_NAME, ffParseSwapCommandOptions, ffParseSwapJsonObject, ffPrintSwap, ffGenerateSwapJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_SWAP_MODULE_NAME, ffParseSwapCommandOptions, ffParseSwapJsonObject, ffPrintSwap, ffGenerateSwapJson, ffPrintSwapHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -126,3 +126,12 @@ void ffGenerateSwapJson(FF_MAYBE_UNUSED FFSwapOptions* options, yyjson_mut_doc*
|
||||
yyjson_mut_obj_add_uint(doc, obj, "total", storage.bytesTotal);
|
||||
yyjson_mut_obj_add_uint(doc, obj, "used", storage.bytesUsed);
|
||||
}
|
||||
|
||||
void ffPrintSwapHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_SWAP_MODULE_NAME, "{1} / {2} ({3})", FF_SWAP_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Used size",
|
||||
"Total size",
|
||||
"Percentage used"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseSwapCommandOptions(FFSwapOptions* options, const char* key, const ch
|
||||
void ffDestroySwapOptions(FFSwapOptions* options);
|
||||
void ffParseSwapJsonObject(FFSwapOptions* options, yyjson_val* module);
|
||||
void ffGenerateSwapJson(FFSwapOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintSwapHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user