mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Logo: trait - as an alias for /dev/stdin
which can be useful where `/dev/stdin` is not available, eg. on Windows
This commit is contained in:
+2
-1
@@ -1205,7 +1205,8 @@ static void parseArguments(FFdata* data, int argc, const char** argv)
|
||||
}
|
||||
|
||||
if(i == argc - 1 || (
|
||||
*argv[i + 1] == '-' &&
|
||||
argv[i + 1][0] == '-' &&
|
||||
argv[i + 1][1] != '\0' && // `-` is used as an alias for `/dev/stdin`
|
||||
strcasecmp(argv[i], "--separator-string") != 0 // Separator string can start with a -
|
||||
)) {
|
||||
parseOption(data, argv[i], NULL);
|
||||
|
||||
+4
-1
@@ -359,7 +359,10 @@ static bool logoPrintFileIfExists(bool doColorReplacement, bool raw)
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY content = ffStrbufCreate();
|
||||
|
||||
if(!ffAppendFileBuffer(options->source.chars, &content))
|
||||
if(ffStrbufEqualS(&options->source, "-")
|
||||
? !ffAppendFDBuffer(FFUnixFD2NativeFD(STDIN_FILENO), &content)
|
||||
: !ffAppendFileBuffer(options->source.chars, &content)
|
||||
)
|
||||
{
|
||||
fprintf(stderr, "Logo: Failed to load file content from logo source: %s \n", options->source.chars);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user