]> wolfpit.net Git - tool/Arch-pacman/.git/commitdiff
pacdiff: allow multiple separated options
authorJonathan Frazier <eyeswide@gmail.com>
Mon, 15 Jul 2013 16:56:03 +0000 (12:56 -0400)
committerAllan McRae <allan@archlinux.org>
Tue, 30 Jul 2013 03:00:10 +0000 (13:00 +1000)
loop over arguments, this will allow adding options such as --nocolor

Signed-off-by: Jonathan Frazier <eyeswide@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
contrib/pacdiff.sh.in

index eda3878dae43f19db0fa15f834dc71e2274b29e6..ce7de5292d9f09b54c9506943038d60e2928a6d9 100644 (file)
@@ -64,8 +64,8 @@ cmd() {
        fi
 }
 
-if [ $# -gt 0 ]; then
-       case $1 in
+while [[ -n "$1" ]]; do        
+       case "$1" in
                -l|--locate)
                locate=1;;
                -V|--version)
@@ -75,7 +75,8 @@ if [ $# -gt 0 ]; then
                *)
                usage; exit 1;;
        esac
-fi
+       shift
+done
 
 # see http://mywiki.wooledge.org/BashFAQ/020
 while IFS= read -u 3 -r -d '' pacfile; do