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:
@@ -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"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user