Commit 3eebc07f authored by Dylan Araps's avatar Dylan Araps

better arg handling

parent f765e646
...@@ -3119,19 +3119,24 @@ getargs() { ...@@ -3119,19 +3119,24 @@ getargs() {
# Screenshot # Screenshot
--scrot | -s) --scrot | -s)
scrot="on" scrot="on"
if [ "$2" ]; then case "$2" in
scrot_name="${2##*/}" "--"* | "") ;;
scrot_dir="${2/$scrot_name}" *)
fi scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
;;
esac
;; ;;
--upload | -su) --upload | -su)
scrot="on" scrot="on"
scrot_upload="on" scrot_upload="on"
case "$2" in
if [ "$2" ]; then "--"* | "") ;;
scrot_name="${2##*/}" *)
scrot_dir="${2/$scrot_name}" scrot_name="${2##*/}"
fi 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" ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment