Changeset 25957 for main/trunk/greenstone2/perllib/plugins/PrintInfo.pm
- Timestamp:
- 2012-07-17T15:17:30+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PrintInfo.pm
r24347 r25957 47 47 use printusage; 48 48 49 my $arguments = []; 49 my $arguments = [ 50 { 'name' => "gs_version", 51 'desc' => "{PrintInfo.gs_version}", 52 'type' => "string", 53 'reqd' => "no", 54 'hiddengli' => "yes" } 55 56 ]; 50 57 51 58 my $options = { 'name' => "PrintInfo", … … 62 69 my $plugin_name = (defined $pluginlist->[0]) ? $pluginlist->[0] : $class; 63 70 64 71 if ($plugin_name eq $class) { 65 72 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 66 73 push(@{$hashArgOptLists->{"OptList"}},$options); 67 74 } 68 75 my $self = {}; 69 76 $self->{'outhandle'} = STDERR; 70 77 $self->{'option_list'} = $hashArgOptLists->{"OptList"}; 71 78 $self->{"info_only"} = 0; 72 79 $self->{'gs_version'} = "2"; 73 80 # Check if gsdlinfo is in the argument list or not - if it is, don't parse 74 # the args, just return the object. 81 # the args, just return the object. 82 # gsdlinfo must come before gs_version. both are set by plugin.pm 83 my $v=0; 75 84 foreach my $strArg (@{$args}) 76 85 { 77 if($strArg eq "-gsdlinfo") 86 if ($v) { 87 $self->{'gs_version'} = $strArg; 88 last; 89 } 90 elsif($strArg eq "-gsdlinfo") 78 91 { 79 92 $self->{"info_only"} = 1; 80 return bless $self, $class; 81 } 82 } 83 93 #return bless $self, $class; 94 } 95 elsif ($strArg eq "-gs_version") { 96 $v = 1; 97 } 98 } 99 100 if ($self->{"info_only"}) { 101 return bless $self, $class; 102 } 84 103 if (defined $auxiliary) { # don't parse the args here 85 104 return bless $self, $class; 105 } 106 107 # now that we are passed printing out info, we do need to add in this class's options so that they are available for parsing. 108 if ($plugin_name ne $class) { 109 push(@{$hashArgOptLists->{"ArgList"}},@{$arguments}); 110 push(@{$hashArgOptLists->{"OptList"}},$options); 86 111 } 87 112
Note:
See TracChangeset
for help on using the changeset viewer.