mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -71,7 +71,7 @@ void ffPrintTitle(FFTitleOptions* options)
|
||||
|
||||
void ffInitTitleOptions(FFTitleOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_TITLE_MODULE_NAME, ffParseTitleCommandOptions, ffParseTitleJsonObject, ffPrintTitle, ffGenerateTitleJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_TITLE_MODULE_NAME, ffParseTitleCommandOptions, ffParseTitleJsonObject, ffPrintTitle, ffGenerateTitleJson, ffPrintTitleHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
ffStrbufSetStatic(&options->moduleArgs.key, " ");
|
||||
|
||||
@@ -172,3 +172,17 @@ void ffGenerateTitleJson(FF_MAYBE_UNUSED FFTitleOptions* options, yyjson_mut_doc
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "exePath", &instance.state.platform.exePath);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "userShell", &instance.state.platform.userShell);
|
||||
}
|
||||
|
||||
void ffPrintTitleHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_TITLE_MODULE_NAME, "{6}{7}{8}", FF_TITLE_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"User name",
|
||||
"Host name",
|
||||
"Home directory",
|
||||
"Executable path of current process",
|
||||
"User's default shell",
|
||||
"User name (colored)",
|
||||
"@ symbol (colored)",
|
||||
"Host name (colored)"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseTitleCommandOptions(FFTitleOptions* options, const char* key, const
|
||||
void ffDestroyTitleOptions(FFTitleOptions* options);
|
||||
void ffParseTitleJsonObject(FFTitleOptions* options, yyjson_val* module);
|
||||
void ffGenerateTitleJson(FFTitleOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintTitleHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user