Changeset 12546
- Timestamp:
- 2006-08-24T16:19:13+12:00 (18 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/BasClas.pm
r11681 r12546 263 263 264 264 # general options available to all classifiers 265 if( !parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))265 if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1) 266 266 { 267 267 #print out the text usage of this classifier. -
trunk/gsdl/perllib/downloaders/BasDownload.pm
r11783 r12546 33 33 use gsprintf 'gsprintf'; 34 34 use printusage; 35 use parse2; 35 36 36 37 # suppress the annoying "subroutine redefined" warning that various … … 73 74 delete $self->{"info_only"}; 74 75 75 if( !parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))76 if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1) 76 77 { 77 78 my $classTempClass = bless $self, $class; -
trunk/gsdl/perllib/parse2.pm
r11650 r12546 185 185 # Parameters: 1.(Array pointer of the user given argument) 186 186 # 2.(Array pointer of plugin pre-defined argument list) 187 # 3.( Selfpointer, where we store all the argument value)187 # 3.(Hash pointer, where we store all the argument value) 188 188 # Pre-condition: Plugin gives the parameters to parse function in parse2 189 # Post-condition: Store all the default or user given values to the $self->{$ArgumentName}. 190 # Since $self is a pointer from plugin, plugin will have every values we set. 191 # Return value: 1 is parsing successful, 0 is failed. 189 # Post-condition: Store all the default or user given values to the hash->{$ArgumentName}. 190 # Since hash may be a plugin $self, plugin will have every values we set. 191 # 4. Optional "allow_extra_options" argument. If this is set, then 192 # its ok to have arguments that are not in the predefined list 193 # Return value: -1 if parsing is unsuccessful 194 # 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. 192 195 #----------------------------------------- 193 196 sub parse … … 239 242 if(processArg($hashArg{$strOneArg},$aryptUserArguList,\%hashInputArg) == 0){ 240 243 print STDERR "<BadArgumentValue a=$strOneArg>\n"; 241 return 0;}244 return -1;} 242 245 } 243 246 … … 254 257 print STDERR "<BadArgument a=$strOneArg>\n"; 255 258 print STDERR " Error: occur in parse2.pm::parse()\n Extra Arguments: $strOneArg\n"; 256 return 0;259 return -1; 257 260 } 258 261 } … … 271 274 { 272 275 print STDERR " Error: occur in parse2.pm::parse()\n Invalid Argument: $strOneArg\n"; 273 return 0;276 return -1; 274 277 } 275 278 } … … 294 297 if(defined $hashOneArg->{"range"}) 295 298 { 296 if(checkRange($hashOneArg->{"range"},$hashInputArg{$strArgName},$strArgName) == 0){ return 0;}299 if(checkRange($hashOneArg->{"range"},$hashInputArg{$strArgName},$strArgName) == 0){ return -1;} 297 300 } 298 301 if(defined $hashOneArg->{"char_length"}) 299 302 { 300 if(checkCharLength($hashOneArg->{"char_length"},$hashInputArg{$strArgName},$strArgName) == 0){ return 0;}303 if(checkCharLength($hashOneArg->{"char_length"},$hashInputArg{$strArgName},$strArgName) == 0){ return -1;} 301 304 } 302 305 $self->{"$strArgName"} = $hashInputArg{"$strArgName"}; … … 334 337 else 335 338 { 336 return 1;339 return 0; 337 340 } 338 341 } -
trunk/gsdl/perllib/plugins/BasPlug.pm
r12270 r12546 392 392 } 393 393 394 if( !parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))394 if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1) 395 395 { 396 396 my $classTempClass = bless $self, $class; -
trunk/gsdl/perllib/plugouts/BasPlugout.pm
r12459 r12546 34 34 use gsprintf 'gsprintf'; 35 35 use printusage; 36 use parse2; 36 37 37 38 # suppress the annoying "subroutine redefined" warning that various … … 111 112 delete $self->{"info_only"}; 112 113 113 if( !parse2::parse($args,$hashArgOptLists->{"ArgList"},$self))114 if(parse2::parse($args,$hashArgOptLists->{"ArgList"},$self) == -1) 114 115 { 115 116 my $classTempClass = bless $self, $class;
Note:
See TracChangeset
for help on using the changeset viewer.