From cc520e42b6060897e9aeea6cdd1348a2dd9546a8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 2 Oct 2016 23:58:08 +1100 Subject: [PATCH] Move scrot args to a separate function --- neofetch | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/neofetch b/neofetch index d255d620..f75d9ffc 100755 --- a/neofetch +++ b/neofetch @@ -2852,6 +2852,21 @@ dynamicprompt() { # }}} +# Scrot args {{{ + +scrot_args() { + scrot="on" + case "$2" in + "--"* | "") ;; + *) + scrot_name="${2##*/}" + scrot_dir="${2/$scrot_name}" + ;; + esac +} + +# }}} + # }}} # Usage {{{ @@ -3118,26 +3133,13 @@ getargs() { # Screenshot --scrot | -s) - scrot="on" - case "$2" in - "--"* | "") ;; - *) - scrot_name="${2##*/}" - scrot_dir="${2/$scrot_name}" - ;; - esac + scrot_args "$@" ;; --upload | -su) - scrot="on" scrot_upload="on" - case "$2" in - "--"* | "") ;; - *) - scrot_name="${2##*/}" - scrot_dir="${2/$scrot_name}" - ;; - esac + scrot_args "$@" ;; + --image_host) image_host="$2" ;; --scrot_cmd) scrot_cmd="$2" ;;