[Swift-commit] r7545 - in SwiftApps/swift-galaxy: . swift

ketan at ci.uchicago.edu ketan at ci.uchicago.edu
Sun Feb 2 17:39:55 CST 2014


Author: ketan
Date: 2014-02-02 17:39:54 -0600 (Sun, 02 Feb 2014)
New Revision: 7545

Modified:
   SwiftApps/swift-galaxy/README.txt
   SwiftApps/swift-galaxy/swift/swiftforeachrange.sh
   SwiftApps/swift-galaxy/swift/swiftforeachrange.xml
Log:
documentation for foreach

Modified: SwiftApps/swift-galaxy/README.txt
===================================================================
--- SwiftApps/swift-galaxy/README.txt	2014-02-02 02:51:27 UTC (rev 7544)
+++ SwiftApps/swift-galaxy/README.txt	2014-02-02 23:39:54 UTC (rev 7545)
@@ -34,6 +34,17 @@
 
 5. Invoke it by entering any number in the dialog box or leaving it to default.
 
-6. For examples of othe Galaxy-Swift tools, look into the swift directoty.
+6. For examples of other Galaxy-Swift tools, look into the swift directoty.
 
+== Description of the foreach* Swift-Galaxy tools ==
 
+There are two versions of foreach Swift tools in this implementation. The
+"numrangeforeach" tool is used to run a Swift foreach loop over a range of
+numbers for an arbitrary executable. The executable will run with the numbers
+as commandline arguments. User can add arbitrary string arguments in addition
+to the number argument to the call to executable.
+
+The second version is the "listforeach". It runs similar to the above described
+numrangeforeach except that the iteration takes place over a list of items
+provided as a file. Each item in the list is delivered to the selected
+executable as a first commandline argument.  

Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.sh
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.sh	2014-02-02 02:51:27 UTC (rev 7544)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.sh	2014-02-02 23:39:54 UTC (rev 7545)
@@ -22,19 +22,25 @@
 shift
 logfile=$1
 
+while [ $# -gt 0 ] ; do
+  a="$a""$1"
+  shift 
+done
+
+
 #Build Swift source code
 cat << EOF > /tmp/script.swift
 type file;
 
-app (file _out, file _err) anapp(file _exec, int _i){
-    sh @_exec _i stdout=@_out stderr=@_err;
+app (file _out, file _err) anapp(file _exec, int _i, string _args){
+    sh @_exec _i _args stdout=@_out stderr=@_err;
 }
-
+string args="$a"
 file exec<"$executable">;
 foreach i in [$rstart:$rend:$stepsize]{
     file out <single_file_mapper; file=@strcat("$outloc", "/", ".", i, ".out")>;
     file err <single_file_mapper; file=@strcat("$outloc", "/", ".", i, ".err")>;
-    (out,err) = anapp(exec, i);
+    (out,err) = anapp(exec, i, args);
 }
 EOF
 

Modified: SwiftApps/swift-galaxy/swift/swiftforeachrange.xml
===================================================================
--- SwiftApps/swift-galaxy/swift/swiftforeachrange.xml	2014-02-02 02:51:27 UTC (rev 7544)
+++ SwiftApps/swift-galaxy/swift/swiftforeachrange.xml	2014-02-02 23:39:54 UTC (rev 7545)
@@ -11,6 +11,10 @@
         $outloc
         $logfile
         $outlist
+        #for $a in $arg
+            ${a.argname}
+        #end for
+
     </command>
 
     <inputs>




More information about the Swift-commit mailing list