better disk output

This commit is contained in:
Linus Dierheimer
2021-03-28 15:38:52 +02:00
parent 184eafce20
commit c44bd6dbc1
8 changed files with 91 additions and 16 deletions
+5 -1
View File
@@ -84,6 +84,8 @@ static inline void printHelp()
" --lib-PCI <path>\n"
" --lib-X11 <path>\n"
" --lib-Xrandr <path>\n"
"Module specific options:\n"
" --disk-folders <folders>: A colon seperated list of folder paths for the disk output. Default is \"/:/home\"\n"
"\n"
"If an value starts with an ?, it is optional. \"true\" will be used if not set.\n"
"An (+) at the end indicates that more help can be printed with --help <option>\n"
@@ -238,7 +240,7 @@ static inline void printCommandHelp(const char* command)
else if(strcasecmp(command, "memory-format") == 0)
constructAndPrintCommandHelpFormat("memory", "{}MiB / {}MiB ({}%)", 3, "Used memory", "Total memory", "Used memory percentage");
else if(strcasecmp(command, "disk-format") == 0)
constructAndPrintCommandHelpFormat("disk", "{}GB / {}GB ({}%)", 3, "Used disk space", "Total disk space", "Used disk space percentage");
constructAndPrintCommandHelpFormat("disk", "{}GB / {}GB ({4}%)", 4, "Used disk space", "Total disk space", "Number of files", "Used disk space percentage");
else if(strcasecmp(command, "battery-format") == 0)
constructAndPrintCommandHelpFormat("battery", "{} {} ({}) [{}%; {}]", 5, "Battery manufactor", "Battery model", "Battery technology", "Battery capacity", "Battery status");
else if(strcasecmp(command, "locale-format") == 0)
@@ -422,6 +424,8 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
optionParseString(key, value, &instance->config.libX11);
else if(strcasecmp(key, "--lib-Xrandr") == 0)
optionParseString(key, value, &instance->config.libXrandr);
else if(strcasecmp(key, "--disk-folders") == 0)
optionParseString(key, value, &instance->config.diskFolders);
else
{
printf("Error: unknown option: %s\n", key);