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
+11 -1
View File
@@ -44,7 +44,7 @@ void ffPrintOpenGL(FFOpenGLOptions* options)
void ffInitOpenGLOptions(FFOpenGLOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_OPENGL_MODULE_NAME, ffParseOpenGLCommandOptions, ffParseOpenGLJsonObject, ffPrintOpenGL, ffGenerateOpenGLJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_OPENGL_MODULE_NAME, ffParseOpenGLCommandOptions, ffParseOpenGLJsonObject, ffPrintOpenGL, ffGenerateOpenGLJson, ffPrintOpenGLHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
#if defined(__linux__) || defined(__FreeBSD__)
@@ -143,3 +143,13 @@ void ffGenerateOpenGLJson(FF_MAYBE_UNUSED FFOpenGLOptions* options, yyjson_mut_d
ffStrbufDestroy(&result.vendor);
ffStrbufDestroy(&result.slv);
}
void ffPrintOpenGLHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_OPENGL_MODULE_NAME, "{1}", FF_OPENGL_NUM_FORMAT_ARGS, (const char* []) {
"version",
"renderer",
"vendor",
"shading language version"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseOpenGLCommandOptions(FFOpenGLOptions* options, const char* key, cons
void ffDestroyOpenGLOptions(FFOpenGLOptions* options);
void ffParseOpenGLJsonObject(FFOpenGLOptions* options, yyjson_val* module);
void ffGenerateOpenGLJson(FFOpenGLOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintOpenGLHelpFormat(void);