From 7f846dadaf8a36137edfdb719c8fe57336beefe3 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Mon, 6 Dec 2021 20:02:49 +0100 Subject: [PATCH] Fix --logo option when using not existent file --- completions/zsh | 18 ++++++++++++++++++ src/common/logo.c | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 completions/zsh diff --git a/completions/zsh b/completions/zsh new file mode 100644 index 000000000..45fb3f2e1 --- /dev/null +++ b/completions/zsh @@ -0,0 +1,18 @@ +#compdef _fastfetch fastfetch + +function _fastfetch() { + local line + + # single options + + _arguments -C + + if [[ ${#line[@]} -eq 0 ]]; then + _arguments -C \ + {-h,--help}'[print help message and exit]' \ + {-v,--version}'[print version and exit]' + fi + + _arguments -C \ + '(--structure)'{-s,--structure}'[Supply the structure to use]' +} diff --git a/src/common/logo.c b/src/common/logo.c index 46d820dfe..97b472b17 100644 --- a/src/common/logo.c +++ b/src/common/logo.c @@ -852,7 +852,7 @@ void ffLoadLogoSet(FFinstance* instance, const char* logo) ffStrbufDestroy(&logoChars); if(instance->config.showErrors) printf(FASTFETCH_TEXT_MODIFIER_ERROR"Error: unknown logo / logo file not found: %s"FASTFETCH_TEXT_MODIFIER_RESET"\n", logo); - instance->config.logo = getLogoUnknown(); + setLogo(instance, getLogoUnknown()); return; }