mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
print default structure / modules
This commit is contained in:
@@ -99,6 +99,8 @@ __fastfetch_completion()
|
||||
"--list-logos"
|
||||
"--print-logos"
|
||||
"--print-default-config"
|
||||
"--print-default-structure"
|
||||
"--print-available-modules"
|
||||
)
|
||||
|
||||
local FF_OPTIONS_HELP=(
|
||||
|
||||
+51
-7
@@ -34,15 +34,17 @@ static inline void printHelp()
|
||||
"Usage: fastfetch <options>\n"
|
||||
"\n"
|
||||
"Informative options:\n"
|
||||
" -h, --help: shows this message and exits\n"
|
||||
" -h <command>, --help <command>: shows help for a specific command and exits\n"
|
||||
" -v --version: prints the version of fastfetch and exits\n"
|
||||
" --list-logos: list available logos and exits\n"
|
||||
" --print-logos: shows available logos and exits\n"
|
||||
" --print-default-config: prints the default config and exits\n"
|
||||
" -h, --help: shows this message and exits\n"
|
||||
" -h <command>, --help <command>: shows help for a specific command and exits\n"
|
||||
" -v --version: prints the version of fastfetch and exits\n"
|
||||
" --list-logos: list available logos and exits\n"
|
||||
" --print-logos: shows available logos and exits\n"
|
||||
" --print-default-config: prints the default config and exits\n"
|
||||
" --print-default-structure: prints the default stucture and exits\n"
|
||||
" --print-available-modules: prints a list of available modules and exits\n"
|
||||
"\n"
|
||||
"General options:\n"
|
||||
" --structure <structure>: sets the structure of the fetch. Must be a colon seperated list of keys\n"
|
||||
" --structure <structure>: sets the structure of the fetch. Must be a colon seperated list of keys. Use --print-available-modules to show the default\n"
|
||||
" --set <key=value>: hard set the value of an key\n"
|
||||
" -c <color>, --color <color>: sets the color of the keys. Must be a linux console color code (+)\n"
|
||||
" --spacing <width>: sets the distance between logo and text\n"
|
||||
@@ -130,6 +132,38 @@ static inline void printCommandHelpFormat()
|
||||
);
|
||||
}
|
||||
|
||||
static inline void printAvailableModules()
|
||||
{
|
||||
puts(
|
||||
"Battery\n"
|
||||
"Break\n"
|
||||
"Colors\n"
|
||||
"CPU\n"
|
||||
"DE\n"
|
||||
"Disk\n"
|
||||
"Font\n"
|
||||
"GPU\n"
|
||||
"Host\n"
|
||||
"Icons\n"
|
||||
"Kernel\n"
|
||||
"Locale\n"
|
||||
"Memory\n"
|
||||
"OS\n"
|
||||
"Packages\n"
|
||||
"Resolution\n"
|
||||
"Seperator\n"
|
||||
"Shell\n"
|
||||
"Terminal\n"
|
||||
"TerminalFont\n"
|
||||
"Theme\n"
|
||||
"Title\n"
|
||||
"Uptime\n"
|
||||
"WM\n"
|
||||
"\n"
|
||||
"+ Additional defined by --set"
|
||||
);
|
||||
}
|
||||
|
||||
static void constructAndPrintCommandHelpFormat(const char* name, const char* def, uint32_t numArgs, ...)
|
||||
{
|
||||
va_list argp;
|
||||
@@ -266,6 +300,16 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
|
||||
puts(FASTFETCH_DEFAULT_CONFIG);
|
||||
exit(0);
|
||||
}
|
||||
else if(strcasecmp(key, "--print-default-structure") == 0)
|
||||
{
|
||||
puts(FASTFETCH_DEFAULT_STRUCTURE);
|
||||
exit(0);
|
||||
}
|
||||
else if(strcasecmp(key, "--print-available-modules") == 0)
|
||||
{
|
||||
printAvailableModules();
|
||||
exit(0);
|
||||
}
|
||||
else if(strcasecmp(key, "--spacing") == 0)
|
||||
{
|
||||
if(value == NULL)
|
||||
|
||||
Reference in New Issue
Block a user