Move scrot args to a separate function

This commit is contained in:
Dylan Araps 2016-10-02 23:58:08 +11:00
parent 3eebc07f2a
commit cc520e42b6

View file

@ -2852,6 +2852,21 @@ dynamicprompt() {
# }}} # }}}
# Scrot args {{{
scrot_args() {
scrot="on"
case "$2" in
"--"* | "") ;;
*)
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
;;
esac
}
# }}}
# }}} # }}}
# Usage {{{ # Usage {{{
@ -3118,26 +3133,13 @@ getargs() {
# Screenshot # Screenshot
--scrot | -s) --scrot | -s)
scrot="on" scrot_args "$@"
case "$2" in
"--"* | "") ;;
*)
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
;;
esac
;; ;;
--upload | -su) --upload | -su)
scrot="on"
scrot_upload="on" scrot_upload="on"
case "$2" in scrot_args "$@"
"--"* | "") ;;
*)
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
;;
esac
;; ;;
--image_host) image_host="$2" ;; --image_host) image_host="$2" ;;
--scrot_cmd) scrot_cmd="$2" ;; --scrot_cmd) scrot_cmd="$2" ;;