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 {{{
@ -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" ;;