mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Logo: improves error message for chafa options
This commit is contained in:
+8
-3
@@ -159,10 +159,10 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons
|
||||
ffOptionParseString(key, value, &options->source);
|
||||
options->type = FF_LOGO_TYPE_IMAGE_RAW;
|
||||
} else if ((subKey = ffOptionTestPrefix(key, "chafa"))) {
|
||||
#if FF_HAVE_CHAFA
|
||||
if (subKey[0] == '\0') {
|
||||
ffOptionParseString(key, value, &options->source);
|
||||
options->type = FF_LOGO_TYPE_IMAGE_CHAFA;
|
||||
#if FF_HAVE_CHAFA
|
||||
} else if (ffStrEqualsIgnCase(subKey, "fg-only")) {
|
||||
options->chafaFgOnly = ffOptionParseBoolean(value);
|
||||
} else if (ffStrEqualsIgnCase(subKey, "symbols")) {
|
||||
@@ -192,10 +192,13 @@ bool ffOptionsParseLogoCommandLine(FFOptionsLogo* options, const char* key, cons
|
||||
{ "DIFFUSION", 2 },
|
||||
{},
|
||||
});
|
||||
#endif
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
fputs("Error: Chafa options are not supported because Fastfetch was built without Chafa support\n", stderr);
|
||||
exit(477);
|
||||
#endif
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -348,8 +351,8 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo
|
||||
}
|
||||
options->position = (FFLogoPosition) value;
|
||||
continue;
|
||||
#if FF_HAVE_CHAFA
|
||||
} else if (unsafe_yyjson_equals_str(key, "chafa")) {
|
||||
#if FF_HAVE_CHAFA
|
||||
if (!yyjson_is_obj(val)) {
|
||||
return "Chafa config must be an object";
|
||||
}
|
||||
@@ -416,6 +419,8 @@ const char* ffOptionsParseLogoJsonConfig(FFOptionsLogo* options, yyjson_val* roo
|
||||
options->chafaDitherMode = (uint32_t) value;
|
||||
}
|
||||
continue;
|
||||
#else
|
||||
return "Chafa options are not supported because Fastfetch was built without Chafa support";
|
||||
#endif
|
||||
} else {
|
||||
return "Unknown logo key";
|
||||
|
||||
Reference in New Issue
Block a user