Index: /trunk/gsdl/perllib/classify/BasClas.pm
===================================================================
--- /trunk/gsdl/perllib/classify/BasClas.pm	(revision 12545)
+++ /trunk/gsdl/perllib/classify/BasClas.pm	(revision 12546)
@@ -263,5 +263,5 @@
 
     # general options available to all classifiers
-    if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))
+    if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1)
     {
 	#print out the text usage of this classifier. 
Index: /trunk/gsdl/perllib/downloaders/BasDownload.pm
===================================================================
--- /trunk/gsdl/perllib/downloaders/BasDownload.pm	(revision 12545)
+++ /trunk/gsdl/perllib/downloaders/BasDownload.pm	(revision 12546)
@@ -33,4 +33,5 @@
 use gsprintf 'gsprintf';
 use printusage;
+use parse2;
 
 # suppress the annoying "subroutine redefined" warning that various
@@ -73,5 +74,5 @@
     delete $self->{"info_only"};
     
-    if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))
+    if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1)
     {
 	my $classTempClass = bless $self, $class;
Index: /trunk/gsdl/perllib/parse2.pm
===================================================================
--- /trunk/gsdl/perllib/parse2.pm	(revision 12545)
+++ /trunk/gsdl/perllib/parse2.pm	(revision 12546)
@@ -185,9 +185,12 @@
 # Parameters: 1.(Array pointer of the user given argument)
 #             2.(Array pointer of plugin pre-defined argument list)  
-#             3.(Self pointer, where we store all the argument value)
+#             3.(Hash pointer, where we store all the argument value)
 # Pre-condition: Plugin gives the parameters to parse function in parse2 
-# Post-condition: Store all the default or user given values to the $self->{$ArgumentName}.
-#                 Since $self is a pointer from plugin, plugin will have every values we set.
-# Return value: 1 is parsing successful, 0 is failed.
+# Post-condition: Store all the default or user given values to the hash->{$ArgumentName}.
+#                 Since hash may be a plugin $self, plugin will have every values we set.
+#             4. Optional "allow_extra_options" argument. If this is set, then
+#                its ok to have arguments that are not in the predefined list
+# Return value: -1 if parsing is unsuccessful
+#                other value for success. This will be 0 unless "allow_extra_options" is set, in which case it will be the number of extra arguments found. 
 #-----------------------------------------
 sub parse
@@ -239,5 +242,5 @@
 		if(processArg($hashArg{$strOneArg},$aryptUserArguList,\%hashInputArg) == 0){ 
 		    print STDERR "<BadArgumentValue a=$strOneArg>\n";
-		    return 0;}
+		    return -1;}
 	    }
 	    
@@ -254,5 +257,5 @@
 		    print STDERR "<BadArgument a=$strOneArg>\n";
 		    print STDERR " Error: occur in parse2.pm::parse()\n Extra Arguments: $strOneArg\n";
-		    return 0;
+		    return -1;
 		}
 	    }
@@ -271,5 +274,5 @@
 	    {
 		print STDERR " Error: occur in parse2.pm::parse()\n Invalid Argument: $strOneArg\n";
-		return 0;
+		return -1;
 	    }
 	}
@@ -294,9 +297,9 @@
 	    if(defined $hashOneArg->{"range"}) 
 	    {
-		if(checkRange($hashOneArg->{"range"},$hashInputArg{$strArgName},$strArgName) == 0){ return 0;}
+		if(checkRange($hashOneArg->{"range"},$hashInputArg{$strArgName},$strArgName) == 0){ return -1;}
 	    }
 	    if(defined $hashOneArg->{"char_length"})
 	    {
-		if(checkCharLength($hashOneArg->{"char_length"},$hashInputArg{$strArgName},$strArgName) == 0){ return 0;}
+		if(checkCharLength($hashOneArg->{"char_length"},$hashInputArg{$strArgName},$strArgName) == 0){ return -1;}
 	    }
 	    $self->{"$strArgName"} = $hashInputArg{"$strArgName"};
@@ -334,5 +337,5 @@
     else
     {
-	return 1;
+	return 0;
     }
 }
Index: /trunk/gsdl/perllib/plugins/BasPlug.pm
===================================================================
--- /trunk/gsdl/perllib/plugins/BasPlug.pm	(revision 12545)
+++ /trunk/gsdl/perllib/plugins/BasPlug.pm	(revision 12546)
@@ -392,5 +392,5 @@
     }
 
-    if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))
+    if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1)
     {
 	my $classTempClass = bless $self, $class;
Index: /trunk/gsdl/perllib/plugouts/BasPlugout.pm
===================================================================
--- /trunk/gsdl/perllib/plugouts/BasPlugout.pm	(revision 12545)
+++ /trunk/gsdl/perllib/plugouts/BasPlugout.pm	(revision 12546)
@@ -34,4 +34,5 @@
 use gsprintf 'gsprintf';
 use printusage;
+use parse2;
 
 # suppress the annoying "subroutine redefined" warning that various
@@ -111,5 +112,5 @@
     delete $self->{"info_only"};
     
-    if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))
+    if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1)
     {
 	my $classTempClass = bless $self, $class;
