From 3eebc07f2a7f53c14be7ab2a09736fb5a8471d71 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 2 Oct 2016 23:51:59 +1100 Subject: [PATCH] better arg handling --- neofetch | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/neofetch b/neofetch index 9b390b6f..d255d620 100755 --- a/neofetch +++ b/neofetch @@ -3119,19 +3119,24 @@ getargs() { # Screenshot --scrot | -s) scrot="on" - if [ "$2" ]; then - scrot_name="${2##*/}" - scrot_dir="${2/$scrot_name}" - fi + case "$2" in + "--"* | "") ;; + *) + scrot_name="${2##*/}" + scrot_dir="${2/$scrot_name}" + ;; + esac ;; --upload | -su) scrot="on" scrot_upload="on" - - if [ "$2" ]; then - scrot_name="${2##*/}" - scrot_dir="${2/$scrot_name}" - fi + case "$2" in + "--"* | "") ;; + *) + scrot_name="${2##*/}" + scrot_dir="${2/$scrot_name}" + ;; + esac ;; --image_host) image_host="$2" ;; --scrot_cmd) scrot_cmd="$2" ;;