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:
@@ -44,7 +44,7 @@ void ffPrintShell(FFShellOptions* options)
|
||||
|
||||
void ffInitShellOptions(FFShellOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_SHELL_MODULE_NAME, ffParseShellCommandOptions, ffParseShellJsonObject, ffPrintShell, ffGenerateShellJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_SHELL_MODULE_NAME, ffParseShellCommandOptions, ffParseShellJsonObject, ffPrintShell, ffGenerateShellJson, ffPrintShellHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
}
|
||||
|
||||
@@ -97,3 +97,15 @@ void ffGenerateShellJson(FF_MAYBE_UNUSED FFShellOptions* options, yyjson_mut_doc
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "processName", &result->shellProcessName);
|
||||
yyjson_mut_obj_add_strbuf(doc, obj, "version", &result->shellVersion);
|
||||
}
|
||||
|
||||
void ffPrintShellHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_SHELL_MODULE_NAME, "{3} {4}", FF_SHELL_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Shell process name",
|
||||
"Shell path with exe name",
|
||||
"Shell exe name",
|
||||
"Shell version",
|
||||
"Shell pid",
|
||||
"Shell pretty name"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user