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
@@ -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"
});
}
+1
View File
@@ -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);