Changeset 10825
- Timestamp:
- 2005-11-02T14:24:39+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/pluginfo.pl
r10578 r10825 84 84 my $blnParseFailed = "false"; 85 85 # general options available to all plugins 86 my $intArgLeftinAfterParsing = parse2::parse(\@ARGV,$arguments,$hashParsingResult,"allow_extra_options"); 87 # If there are more than one argument left after parsing, it mean user input too many arguments. 88 # Error occoured will return 0 89 if($intArgLeftinAfterParsing > 1) 90 { 91 &PrintUsage::print_txt_usage($options, "{pluginfo.params}"); 92 die "\n"; 93 } 86 my $unparsed_args = parse2::parse(\@ARGV,$arguments,$hashParsingResult,"allow_extra_options"); 94 87 95 88 foreach my $strVariable (keys %$hashParsingResult) 96 89 { 97 eval "\$$strVariable = \$hashParsingResult->{\"\$strVariable\"}"; 90 my $value = $hashParsingResult->{$strVariable}; 91 # test to make sure the variable name is 'safe' 92 if ($strVariable !~ /^\w+$/) { 93 die "variable name '$strVariable' isn't safe!"; 94 } 95 eval "\$$strVariable = \$value"; 98 96 } 99 97 … … 118 116 $gsprintf::specialoutputencoding=$encoding; 119 117 } 118 } 119 120 # If there are more than one argument left after parsing, it mean user input too many arguments. 121 # Error occoured will return 0 122 if( $unparsed_args > 1 or (@ARGV && $ARGV[0] =~ /^\-+h/) ) 123 { 124 PrintUsage::print_txt_usage($options, "{pluginfo.params}"); 125 die "\n"; 120 126 } 121 127
Note:
See TracChangeset
for help on using the changeset viewer.