Print the last element of the default structure

#283
This commit is contained in:
Linus Dierheimer 2022-10-10 10:16:43 +02:00
parent 173c9043e3
commit df986d36a2
No known key found for this signature in database
GPG Key ID: 74FA57726CDD7B61
4 changed files with 18 additions and 17 deletions

View File

@ -10,7 +10,7 @@ trim_trailing_whitespace = true
[*.{md,fflogo}]
trim_trailing_whitespace = false
[*.{txt,fflogo}]
[*.{fflogo}]
insert_final_newline = false
[*.yml]

View File

@ -1,3 +1,7 @@
# 1.7.4
The last element in the default structure (currently the color blocks) is now printed again (#283)
# 1.7.3
A lot of small improvements for MacOS & BSD platforms.

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url
project(fastfetch
VERSION 1.7.3
VERSION 1.7.4
LANGUAGES C
DESCRIPTION "Fast system information tool"
HOMEPAGE_URL "https://github.com/LinusDierheimer/fastfetch"
@ -167,9 +167,10 @@ endif()
function(fastfetch_load_text FILENAME OUTVAR)
file(READ "${FILENAME}" TEMP)
string(REPLACE "\n" "\\n" TEMP "${TEMP}")
string(REPLACE "\"" "\\\"" TEMP "${TEMP}")
string(REPLACE "$\\" "" TEMP "${TEMP}")
string(REGEX REPLACE "\n$" "" TEMP "${TEMP}") # Remove trailing newline
string(REPLACE "\n" "\\n" TEMP "${TEMP}") # Replace newlines with \n
string(REPLACE "\"" "\\\"" TEMP "${TEMP}") # Replace quotes with \"
string(REPLACE "$\\" "" TEMP "${TEMP}") # Remove $\, so we can unescape some things
set("${OUTVAR}" "${TEMP}" PARENT_SCOPE)
endfunction(fastfetch_load_text)

View File

@ -780,12 +780,12 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
}
else if(strcasecmp(key, "--print-config-system") == 0)
{
fputs(FASTFETCH_DATATEXT_CONFIG_SYSTEM, stdout);
puts(FASTFETCH_DATATEXT_CONFIG_SYSTEM);
exit(0);
}
else if(strcasecmp(key, "--print-config-user") == 0)
{
fputs(FASTFETCH_DATATEXT_CONFIG_USER, stdout);
puts(FASTFETCH_DATATEXT_CONFIG_USER);
exit(0);
}
else if(strcasecmp(key, "--print-structure") == 0)
@ -795,7 +795,7 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
}
else if(strcasecmp(key, "--list-modules") == 0)
{
fputs(FASTFETCH_DATATEXT_MODULES, stdout);
puts(FASTFETCH_DATATEXT_MODULES);
exit(0);
}
else if(strcasecmp(key, "--list-presets") == 0)
@ -1485,18 +1485,14 @@ int main(int argc, const char** argv)
if(data.structure.length == 0)
ffStrbufAppendS(&data.structure, FASTFETCH_DATATEXT_STRUCTURE);
#define FF_CONTAINS_MODULE_NAME(moduleName)\
ffStrbufContainIgnCaseS(&data.structure, ":" #moduleName ":") ||\
ffStrbufStartsWithIgnCaseS(&data.structure, #moduleName ":") ||\
ffStrbufEndsWithIgnCaseS(&data.structure, ":" #moduleName)
if(FF_CONTAINS_MODULE_NAME(CPUUsage))
if(ffStrbufContainIgnCaseS(&data.structure, "CPUUsage"))
ffPrepareCPUUsage();
if(FF_CONTAINS_MODULE_NAME(PublicIp))
if(ffStrbufContainIgnCaseS(&data.structure, "PublicIp"))
ffPreparePublicIp(&instance);
if(FF_CONTAINS_MODULE_NAME(Weather))
if(ffStrbufContainIgnCaseS(&data.structure, "Weather"))
ffPrepareWeather(&instance);
#undef FF_CONTAINS_MODULE_NAME
ffStart(&instance);