mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -77,7 +77,7 @@ void ffPrintMonitor(FFMonitorOptions* options)
|
||||
|
||||
void ffInitMonitorOptions(FFMonitorOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_MONITOR_MODULE_NAME, ffParseMonitorCommandOptions, ffParseMonitorJsonObject, ffPrintMonitor, ffGenerateMonitorJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_MONITOR_MODULE_NAME, ffParseMonitorCommandOptions, ffParseMonitorJsonObject, ffPrintMonitor, ffGenerateMonitorJson, ffPrintMonitorHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -147,3 +147,16 @@ void ffGenerateMonitorJson(FF_MAYBE_UNUSED FFMonitorOptions* options, yyjson_mut
|
||||
ffStrbufDestroy(&item->name);
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintMonitorHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_MONITOR_MODULE_NAME, "{2}x{3} px - {4}x{5} mm ({6} inches, {7} ppi)", FF_MONITOR_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Display name",
|
||||
"Display native resolution width in pixels",
|
||||
"Display native resolution height in pixels",
|
||||
"Display physical width in millimeters",
|
||||
"Display physical height in millimeters",
|
||||
"Display physical diagonal length in inches",
|
||||
"Display physical pixels per inch (PPI)"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseMonitorCommandOptions(FFMonitorOptions* options, const char* key, co
|
||||
void ffDestroyMonitorOptions(FFMonitorOptions* options);
|
||||
void ffParseMonitorJsonObject(FFMonitorOptions* options, yyjson_val* module);
|
||||
void ffGenerateMonitorJson(FFMonitorOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintMonitorHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user