diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-06-13 15:10:37 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-06-13 15:10:37 +0200 |
commit | 05665095fe4f8299905d7f222b362397bec28619 (patch) | |
tree | ae95c5979d0a06ed92ef88f3f51053196e408428 | |
parent | a7eca07f62d5c91db5998047a2b60b9432fae277 (diff) | |
download | xtools-05665095fe4f8299905d7f222b362397bec28619.tar.gz xtools-05665095fe4f8299905d7f222b362397bec28619.tar.xz xtools-05665095fe4f8299905d7f222b362397bec28619.zip |
xbulk: grok flags -a|-H|-m|-o|-r which take an argument
-rwxr-xr-x | xbulk | 12 |
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 { |