From 70e74768b5329dba314f238c9908b35f7030cf87 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 16 Dec 2016 10:03:44 +1100 Subject: [PATCH 1/2] Args: Fix config bug and remove large case for single regex match --- neofetch | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/neofetch b/neofetch index f4551dab..9693e863 100755 --- a/neofetch +++ b/neofetch @@ -2704,8 +2704,7 @@ color() { # OTHER err() { - err+="$(color 1)[!]\033[0m $1 -" + err+="$(color 1)[!]\033[0m $1\n" } get_script_dir() { @@ -3134,17 +3133,7 @@ exit 1 get_args() { # Check the commandline flags early for '--config none/off' - case "$@" in - *"--config off"* | *'--config "off"'* | *"--config 'off'"* | \ - *"--config none"* | *'--config "none"'* | *"--config 'none'"*) - config="off" - ;; - - *"--config -"*) ;; - *"--config"*) config="off" ;; - esac - - [[ "${config:-on}" == "on" ]] && get_user_config 2>/dev/null + [[ "$@" =~ \-\-config\ ?(off|none) ]] || get_user_config 2>/dev/null while [[ "$1" ]]; do case "$1" in @@ -3291,7 +3280,7 @@ get_args() { # Other "--config") case "$2" in - "none" | "off") config="off" ;; + "none" | "off" | "") config="off" ;; *) config_file="$2"; config="on"; get_user_config 2>/dev/null ;; esac ;; From 3bbe52b93bf12b416d6375fc15cf769c49bf984b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 16 Dec 2016 12:50:39 +1100 Subject: [PATCH 2/2] Args: Fix regex --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 9693e863..23b731d5 100755 --- a/neofetch +++ b/neofetch @@ -3133,7 +3133,7 @@ exit 1 get_args() { # Check the commandline flags early for '--config none/off' - [[ "$@" =~ \-\-config\ ?(off|none) ]] || get_user_config 2>/dev/null + [[ "$@" =~ --config\ ?(off|none) ]] || get_user_config 2>/dev/null while [[ "$1" ]]; do case "$1" in