Global: improve support of --help *-format

Also fix some bugs found when refactoring
This commit is contained in:
李通洲
2023-10-07 13:40:40 +08:00
parent 23d2cc3fdc
commit 12208b2c7c
113 changed files with 746 additions and 557 deletions
+14 -1
View File
@@ -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)"
});
}
+1
View File
@@ -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);