summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-06-13 15:10:37 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-06-13 15:10:37 +0200
commit05665095fe4f8299905d7f222b362397bec28619 (patch)
treeae95c5979d0a06ed92ef88f3f51053196e408428
parenta7eca07f62d5c91db5998047a2b60b9432fae277 (diff)
downloadxtools-05665095fe4f8299905d7f222b362397bec28619.tar.gz
xtools-05665095fe4f8299905d7f222b362397bec28619.tar.xz
xtools-05665095fe4f8299905d7f222b362397bec28619.zip
xbulk: grok flags -a|-H|-m|-o|-r which take an argument
-rwxr-xr-xxbulk12
1 files changed, 7 insertions, 5 deletions
diff --git a/xbulk b/xbulk
index 833910f..523e8fa 100755
--- a/xbulk
+++ b/xbulk
@@ -10,13 +10,15 @@ mainpkg() {
 	echo ${dir##*/}
 }
 
-for pkg; do
-	case $pkg in
-		-n|-k) MAKEARGS="$MAKEARGS $pkg";;
-		-*) ARGS="$ARGS $pkg";;
+while [ $# -gt 0 ]; do
+	case $1 in
+		-n|-k) MAKEARGS="$MAKEARGS $1";;
+		-a|-H|-m|-o|-r) ARGS="$ARGS $1 $2"; shift;;
+		-*) ARGS="$ARGS $1";;
 		*) PKGS="$PKGS
-$(mainpkg $pkg)"
+$(mainpkg $1)"
 	esac
+	shift
 done
 
 {