mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Global: refactor code of -h <module>-format
This commit is contained in:
+10
-11
@@ -44,19 +44,18 @@ void ffParseCustomJsonObject(FFCustomOptions* options, yyjson_val* module)
|
||||
}
|
||||
}
|
||||
|
||||
static FFModuleBaseInfo ffModuleInfo = {
|
||||
.name = FF_CUSTOM_MODULE_NAME,
|
||||
.description = "Print a custom string, with or without key",
|
||||
.parseCommandOptions = (void*) ffParseCustomCommandOptions,
|
||||
.parseJsonObject = (void*) ffParseCustomJsonObject,
|
||||
.printModule = (void*) ffPrintCustom,
|
||||
.generateJsonConfig = (void*) ffGenerateCustomJsonConfig,
|
||||
};
|
||||
|
||||
void ffInitCustomOptions(FFCustomOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(
|
||||
&options->moduleInfo,
|
||||
FF_CUSTOM_MODULE_NAME,
|
||||
"Print a custom string, with or without key",
|
||||
ffParseCustomCommandOptions,
|
||||
ffParseCustomJsonObject,
|
||||
ffPrintCustom,
|
||||
NULL,
|
||||
NULL,
|
||||
ffGenerateCustomJsonConfig
|
||||
);
|
||||
options->moduleInfo = ffModuleInfo;
|
||||
ffOptionInitModuleArg(&options->moduleArgs, "");
|
||||
ffStrbufSetStatic(&options->moduleArgs.key, " ");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user