mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 15:53:51 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -112,7 +112,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
|
||||
|
||||
void ffInitDisplayOptions(FFDisplayOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DISPLAY_MODULE_NAME, ffParseDisplayCommandOptions, ffParseDisplayJsonObject, ffPrintDisplay, ffGenerateDisplayJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_DISPLAY_MODULE_NAME, ffParseDisplayCommandOptions, ffParseDisplayJsonObject, ffPrintDisplay, ffGenerateDisplayJson, ffPrintDisplayHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
options->compactType = FF_DISPLAY_COMPACT_TYPE_NONE;
|
||||
options->preciseRefreshRate = false;
|
||||
@@ -225,3 +225,17 @@ void ffGenerateDisplayJson(FF_MAYBE_UNUSED FFDisplayOptions* options, yyjson_mut
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintDisplayHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_DISPLAY_MODULE_NAME, "{1}x{2} @ {3}Hz (as {4}x{5}) [{7}]", FF_DISPLAY_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Screen width (in pixels)",
|
||||
"Screen height (in pixels)",
|
||||
"Screen refresh rate (in Hz)",
|
||||
"Screen scaled width (in pixels)",
|
||||
"Screen scaled height (in pixels)",
|
||||
"Screen name",
|
||||
"Screen type (builtin, external or unknown)",
|
||||
"Screen rotation (in degrees)",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseDisplayCommandOptions(FFDisplayOptions* options, const char* key, co
|
||||
void ffDestroyDisplayOptions(FFDisplayOptions* options);
|
||||
void ffParseDisplayJsonObject(FFDisplayOptions* options, yyjson_val* module);
|
||||
void ffGenerateDisplayJson(FFDisplayOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintDisplayHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user