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:
@@ -32,7 +32,7 @@ void ffPrintLocale(FFLocaleOptions* options)
|
||||
|
||||
void ffInitLocaleOptions(FFLocaleOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_LOCALE_MODULE_NAME, ffParseLocaleCommandOptions, ffParseLocaleJsonObject, ffPrintLocale, ffGenerateLocaleJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_LOCALE_MODULE_NAME, ffParseLocaleCommandOptions, ffParseLocaleJsonObject, ffPrintLocale, ffGenerateLocaleJson, ffPrintLocaleHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -81,3 +81,10 @@ void ffGenerateLocaleJson(FF_MAYBE_UNUSED FFLocaleOptions* options, yyjson_mut_d
|
||||
|
||||
yyjson_mut_obj_add_strbuf(doc, module, "result", &locale);
|
||||
}
|
||||
|
||||
void ffPrintLocaleHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_LOCALE_MODULE_NAME, "{1}", FF_LOCALE_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Locale code"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseLocaleCommandOptions(FFLocaleOptions* options, const char* key, cons
|
||||
void ffDestroyLocaleOptions(FFLocaleOptions* options);
|
||||
void ffParseLocaleJsonObject(FFLocaleOptions* options, yyjson_val* module);
|
||||
void ffGenerateLocaleJson(FFLocaleOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintLocaleHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user