Author: pcc-guest
Date: 2010-09-04 17:55:46 +0000 (Sat, 04 Sep 2010)
New Revision: 12965

Modified:
   trunk/maven-repo-helper/src/main/share/mh_lib.sh
Log:
Have mh_lib store arguments in array environment variables

Modified: trunk/maven-repo-helper/src/main/share/mh_lib.sh
===================================================================
--- trunk/maven-repo-helper/src/main/share/mh_lib.sh    2010-09-04 17:55:29 UTC 
(rev 12964)
+++ trunk/maven-repo-helper/src/main/share/mh_lib.sh    2010-09-04 17:55:46 UTC 
(rev 12965)
@@ -32,7 +32,8 @@
          if [ -z "$optv" ]; then
             optv=true
          fi
-         export opt_$optn="$optv"
+         export -a opt_$optn
+         eval opt_$optn'+=("$optv")'
       elif [ "-" = "${1:0:1}" ]; then
       # short opt
          optn="${1:1:1}"
@@ -44,7 +45,8 @@
          if [ -z "$optv" ]; then
             optv=true
          fi
-         export opt_$optn="$optv"
+         export -a opt_$optn
+         eval opt_$optn'+=("$optv")'
       else
       # not-opt arg
          ARGV[$ARGC]="$1"
@@ -60,8 +62,8 @@
 {
    while [ -n "$1" ]; do
       optn=$(echo "opt_$1" | sed 's/-/_/g')
-      if [ -n "${!optn}" ]; then
-         echo ${!optn}
+      if [ -n "${!optn[0]}" ]; then
+         echo ${!optn[0]}
          return
       fi
       shift


_______________________________________________
pkg-java-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-java-commits

Reply via email to