Changeset 10229
- Timestamp:
- 2005-07-08T09:56:37+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/BasClas.pm
r10223 r10229 53 53 # 28/11/03 Commented out verbosity argument - John Thompson 54 54 55 use parsargv;55 #use parsargv; 56 56 use gsprintf; 57 57 use printusage; 58 58 use parse2; 59 60 # suppress the annoying "subroutine redefined" warning that various 61 # classifiers cause under perl 5.6 62 $SIG{__WARN__} = sub {warn($_[0]) unless ($_[0] =~ /Subroutine\s+\S+\sredefined/)}; 63 64 use strict; 65 no strict 'subs'; # allow barewords (eg STDERR) as function arguments 59 66 60 67 my $arguments = … … 109 116 my $optionlistref = $self->{'option_list'}; 110 117 my @optionlist = @$optionlistref; 111 my $classifieroptions = pop(@$optionlistref);118 my $classifieroptions = shift(@$optionlistref); 112 119 return if (!defined($classifieroptions)); 113 120 … … 177 184 my $optionlistref = $self->{'option_list'}; 178 185 my @optionlist = @$optionlistref; 179 my $classifieroptions = pop(@$optionlistref);186 my $classifieroptions = shift(@$optionlistref); 180 187 return if (!defined($classifieroptions)); 181 188 … … 216 223 sub new { 217 224 my ($class) = shift (@_); 218 my ($classifierslist,$args, ,$hashArgOptLists) = @_;225 my ($classifierslist,$args,$hashArgOptLists) = @_; 219 226 push(@$classifierslist, $class); 220 227 my $classifier_name = (defined $classifierslist->[0]) ? $classifierslist->[0] : $class; … … 231 238 $self->{"info_only"} = 0; 232 239 233 # Check if gsdlinfo is in the argument list or not. 234 foreach $strArg (@{$args}) 240 # Check if gsdlinfo is in the argument list or not - if it is, don't parse 241 # the args, just return the object. 242 foreach my $strArg (@{$args}) 235 243 { 236 if($strArg eq " gsdlinfo")244 if($strArg eq "-gsdlinfo") 237 245 { 238 246 $self->{"info_only"} = 1; 239 last;240 } 241 } 242 243 # If gsdlinfo is not in the argument list, process the argument normally.244 if( $self->{"info_only"} == 0)247 return bless $self, $class; 248 } 249 } 250 251 # general options available to all classifiers 252 if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self)) 245 253 { 246 my $blnParseFailed = "false"; 247 # general options available to all plugins 248 if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self)) 249 { 250 $blnParseFailed = "true"; 251 } 252 253 # If the parsing wasn't successful, then print out the text usage of this classifier. 254 #print out the text usage of this classifier. 254 255 my $classTempClass = bless $self, $class; 255 if($blnParseFailed eq "true") 256 { 257 &gsprintf(STDERR, "\n{BasClas.bad_general_option}\n", $classifier_name); 258 $classTempClass->print_txt_usage(""); # Use default resource bundle 259 die "\n"; 260 } 261 else 262 { 263 delete $self->{"info_only"}; 264 return $classTempClass; 265 } 266 } 267 268 # If gsdlinfo is in the argument list, do not perform any parsing. 269 else 270 { 271 delete $self->{"info_only"}; 272 return bless $self, $class; 273 } 256 &gsprintf(STDERR, "\n{BasClas.bad_general_option}\n", $classifier_name); 257 $classTempClass->print_txt_usage(""); # Use default resource bundle 258 die "\n"; 259 } 260 261 delete $self->{"info_only"}; 262 return bless $self, $class; 274 263 } 275 264 -
trunk/gsdl/perllib/plugins/BasPlug.pm
r10218 r10229 242 242 my $optionlistref = $self->{'option_list'}; 243 243 my @optionlist = @$optionlistref; 244 my $pluginoptions = pop(@$optionlistref);244 my $pluginoptions = shift(@$optionlistref); 245 245 return if (!defined($pluginoptions)); 246 246 … … 284 284 my $optionlistref = $self->{'option_list'}; 285 285 my @optionlist = @$optionlistref; 286 my $pluginoptions = pop(@$optionlistref);286 my $pluginoptions = shift(@$optionlistref); 287 287 return $maxoffset if (!defined($pluginoptions)); 288 288 … … 311 311 my $optionlistref = $self->{'option_list'}; 312 312 my @optionlist = @$optionlistref; 313 my $pluginoptions = pop(@$optionlistref);313 my $pluginoptions = shift(@$optionlistref); 314 314 return if (!defined($pluginoptions)); 315 315
Note:
See TracChangeset
for help on using the changeset viewer.