]> git.wh0rd.org Git - home.git/commitdiff
imgcrush: parse multiple arguments correctly
authorMike Frysinger <vapier@gentoo.org>
Tue, 17 Oct 2017 03:50:40 +0000 (23:50 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 17 Oct 2017 03:50:40 +0000 (23:50 -0400)
.bin/imgcrush

index 3f04460294bf50b291f323202c72e5971e505ea2..51ba3438b909fa951121ca5b5aea1266f25c798c 100755 (executable)
@@ -21,6 +21,7 @@ crush() {
        case $1 in
        *.jpg|*.jpeg) crush_jpg "$1" ;;
        *.png)        crush_png "$1" ;;
+       *) echo "${0##*/}: unsupported format: $1" >&2 ;;
        esac
 }
 
@@ -31,7 +32,7 @@ main() {
                case $1 in
                -h) usage ;;
                -*) usage 1 ;;
-               *)  crush "$1" ;;
+               *)  crush "$1"; shift ;;
                esac
        done
 }