mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-31 18:13:38 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -33,7 +33,7 @@ void ffPrintWeather(FFWeatherOptions* options)
|
||||
|
||||
void ffInitWeatherOptions(FFWeatherOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_WEATHER_MODULE_NAME, ffParseWeatherCommandOptions, ffParseWeatherJsonObject, ffPrintWeather, ffGenerateWeatherJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_WEATHER_MODULE_NAME, ffParseWeatherCommandOptions, ffParseWeatherJsonObject, ffPrintWeather, ffGenerateWeatherJson, ffPrintWeatherHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
|
||||
ffStrbufInit(&options->location);
|
||||
@@ -124,3 +124,10 @@ void ffGenerateWeatherJson(FFWeatherOptions* options, yyjson_mut_doc* doc, yyjso
|
||||
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "result", &result);
|
||||
}
|
||||
|
||||
void ffPrintWeatherHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_WEATHER_MODULE_NAME, "{1}", FF_WEATHER_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Weather result"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -12,3 +12,4 @@ bool ffParseWeatherCommandOptions(FFWeatherOptions* options, const char* key, co
|
||||
void ffDestroyWeatherOptions(FFWeatherOptions* options);
|
||||
void ffParseWeatherJsonObject(FFWeatherOptions* options, yyjson_val* module);
|
||||
void ffGenerateWeatherJson(FFWeatherOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintWeatherHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user