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
+8 -1
View File
@@ -44,7 +44,7 @@ void ffPrintWallpaper(FFWallpaperOptions* options)
void ffInitWallpaperOptions(FFWallpaperOptions* options)
{
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_WALLPAPER_MODULE_NAME, ffParseWallpaperCommandOptions, ffParseWallpaperJsonObject, ffPrintWallpaper, ffGenerateWallpaperJson);
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_WALLPAPER_MODULE_NAME, ffParseWallpaperCommandOptions, ffParseWallpaperJsonObject, ffPrintWallpaper, ffGenerateWallpaperJson, ffPrintWallpaperHelpFormat);
ffOptionInitModuleArg(&options->moduleArgs);
}
@@ -91,3 +91,10 @@ void ffGenerateWallpaperJson(FF_MAYBE_UNUSED FFWallpaperOptions* options, yyjson
}
yyjson_mut_obj_add_strbuf(doc, module, "result", &fullpath);
}
void ffPrintWallpaperHelpFormat(void)
{
ffPrintModuleFormatHelp(FF_WALLPAPER_MODULE_NAME, "{1}", FF_WALLPAPER_NUM_FORMAT_ARGS, (const char* []) {
"Wallpaper image file"
});
}
+1
View File
@@ -10,3 +10,4 @@ bool ffParseWallpaperCommandOptions(FFWallpaperOptions* options, const char* key
void ffDestroyWallpaperOptions(FFWallpaperOptions* options);
void ffParseWallpaperJsonObject(FFWallpaperOptions* options, yyjson_val* module);
void ffGenerateWallpaperJson(FFWallpaperOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
void ffPrintWallpaperHelpFormat(void);