Index: other-projects/nightly-tasks/diffcol/trunk/task.pl
===================================================================
--- other-projects/nightly-tasks/diffcol/trunk/task.pl	(revision 28114)
+++ other-projects/nightly-tasks/diffcol/trunk/task.pl	(revision 28172)
@@ -47,4 +47,6 @@
 }
 
+my $test_os = $isWin ? "windows" : ($isMac ? "darwin" : "linux");
+my $model_os = "linux"; # default
 
 # TASK_HOME should be the toplevel diffcol folder
@@ -98,5 +100,7 @@
 my @collections = ();
 
+# run_test can take any number of args
 if(scalar(@ARGV) > 1 && $ARGV[0] ne "run_test") {
+    print STDERR "**** Wrong number of arguments\n";
 	&printusage();
 	exit -1;
@@ -111,5 +115,5 @@
 	case qr/^(setup_greenstone|run_test|summarise|upload|all)$/ { $action=$ARGV[0]; }
 	else { 
-	    print STDERR "Bad subcommand.\n"; 
+	    print STDERR "**** Bad subcommand.\n"; 
 	    &printusage; 
 	    exit -1;
@@ -117,5 +121,5 @@
     }
 	
-	# run_test action can take a subaction: nosvn|justdiff. 
+	# run_test action can take a subaction: nosvn|justdiff. It can also take --modelOS (windows|linux|darwin)
 	# nosvn: uses the model-collect as static and copies it over to collect, rebuilding what's currently in model-collect instead of copying 
 	# it out from the svn model-collect again.
@@ -125,17 +129,28 @@
 		shift @collections; # remove action from array
 		
-		if($ARGV[1] =~ m@^--@) {
-			shift @collections; # remove subaction from array
+		for (my $i=0; $i < scalar(@ARGV); $i++) { 
+		    if($ARGV[$i] =~ m@^--@) {
+			shift @collections; # remove subaction/flag from array
 			
-			$subaction = $ARGV[1];			
+			$subaction = $ARGV[$i];
 			if($subaction eq "--justdiff") {
-				$use_local_rebuild = $use_static_model = 1;
+			    $use_local_rebuild = $use_static_model = 1;
 			} elsif ($subaction eq "--nosvn") {
-				$use_static_model = 1;
+			    $use_static_model = 1;
+			#} elsif ($subaction =~ m/\-\-testOS/i && defined $ARGV[$i+1]) {
+			#    $test_os = $ARGV[$i+1];
+			#    $i++;
+			#    shift @collections; # remove test_os value from array
+			} elsif ($subaction =~ m/\-\-modelOS/i && defined $ARGV[$i+1] && $ARGV[$i+1] =~ m/windows|linux|darwin/i) {
+			    $model_os = $ARGV[$i+1];
+			    $i++;
+			    shift @collections; # remove model_os value from array
+			    #print STDERR "Model_os specified: $model_os\n";
 			} else {
-				print STDERR "Bad subaction.\n"; 
-				&printusage; 
-				exit -1;
-			}			
+			    print STDERR "**** Bad subaction/value: ".$ARGV[$i]."\n"; 
+			    &printusage; 
+			    exit -1;
+			}
+		    }
 		}
 		
@@ -238,5 +253,10 @@
 sub printusage
 {
-    print STDERR "Run as: $0 (help|setup_greenstone|run_test <--justdiff|--nosvn> <col1 col2 ...> |summarise|upload|all)\n";
+#    print STDERR "Run as: $0 (help|setup_greenstone|run_test <--modelOS windows|darwin|linux> <--justdiff|--nosvn> <col1 col2 ...> |summarise|upload|all)\n";
+    print STDERR "Run as: $0 (help|setup_greenstone|run_test|summarise|upload|all)\n";
+    print STDERR "where run_test can further take the following optional parameters:\n";
+    print STDERR "\t--modelOS (windows|darwin|linux)\n";
+    print STDERR "\t--justdiff|--nosvn\n";
+    print STDERR "\t<col1 col2 ...>\n";
 }
 
@@ -510,5 +530,7 @@
 		if(-d "collect") {
 			for my $col (@collections) {
-				&File::Path::remove_tree("collect$col") || die "Error could not delete collect: $!";			
+			    if(-d "collect$col") {
+				&File::Path::remove_tree("collect$col") || die "Error could not delete collect: $!";
+			    }			
 			}	
 		}
@@ -604,5 +626,8 @@
 	print STDERR "$collection - Diffing:\n";
 	my $diffcol_dir = &filename_concat($ENV{'TASK_HOME'},"diffcol");
-	$cmd = "diffcol.pl -output xml -verbosity 10 $collection"; # need to run with ./diffcol.pl if bash script
+	
+	# help diffcol to know on what os the model cols were generated
+	# and what os this test machine is (on which the test cols will be generated)
+	$cmd = "diffcol.pl -testos $test_os -modelos $model_os -output xml -verbosity 10 $collection"; # need to run with ./diffcol.pl if bash script
 	&run_diff_script($cmd, $xml_fh, $diffcol_dir);
 
