better arg handling

This commit is contained in:
Dylan Araps 2016-10-02 23:51:59 +11:00
parent f765e646b0
commit 3eebc07f2a

View file

@ -3119,19 +3119,24 @@ getargs() {
# Screenshot
--scrot | -s)
scrot="on"
if [ "$2" ]; then
case "$2" in
"--"* | "") ;;
*)
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
fi
;;
esac
;;
--upload | -su)
scrot="on"
scrot_upload="on"
if [ "$2" ]; then
case "$2" in
"--"* | "") ;;
*)
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
fi
;;
esac
;;
--image_host) image_host="$2" ;;
--scrot_cmd) scrot_cmd="$2" ;;