Changeset 6921 for trunk/gsdl/bin/script/pluginfo.pl
- Timestamp:
- 2004-03-04T15:47:20+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/pluginfo.pl
r5882 r6921 63 63 'args' => $arguments }; 64 64 65 66 sub lookup_string 65 sub gsprintf 67 66 { 68 return &gsprintf:: lookup_string($language, shift(@_));67 return &gsprintf::gsprintf(@_); 69 68 } 70 71 72 sub print_txt_usage73 {74 local $language = shift(@_);75 76 local $programname = $options->{'name'};77 local $programargs = $options->{'args'};78 79 # Find the length of the longest option string80 local $descoffset = 0;81 if (defined($programargs)) {82 $descoffset = &PrintUsage::find_longest_option_string($programargs);83 }84 85 # Produce the usage information using the data structure above86 print STDERR $programname . ": " . &lookup_string($options->{'desc'}) . "\n\n";87 print STDERR " " . &lookup_string("{common.usage}") . ": $programname";88 print STDERR " " . &lookup_string("{pluginfo.params}") . "\n\n";89 90 # Display the program options, if there are some91 if (defined($programargs)) {92 # Calculate the column offset of the option descriptions93 local $optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions94 95 print STDERR " " . &lookup_string("{common.options}") . ":\n";96 97 # Display the program options98 &PrintUsage::print_options_txt($language, $programargs, $optiondescoffset);99 }100 }101 102 69 103 70 … … 112 79 q^language/.*/^, \$language)) 113 80 { 114 & print_txt_usage($language);81 &PrintUsage::print_txt_usage($language, $options, "{pluginfo.params}", 1); 115 82 die "\n"; 116 83 } … … 118 85 my $plugin = shift (@ARGV); 119 86 if (!defined $plugin || $plugin eq "") { 120 print STDERR &lookup_string("{pluginfo.no_plugin_name}") . "\n\n";121 & print_txt_usage($language);87 &gsprintf(STDERR, "{pluginfo.no_plugin_name}\n\n"); 88 &PrintUsage::print_txt_usage($language, $options, "{pluginfo.params}", 1); 122 89 die "\n"; 123 90 } … … 136 103 } 137 104 else { 138 print STDERR "\n$plugin " . &lookup_string("{pluginfo.info}") . ":\n\n";139 print STDERR &lookup_string("{pluginfo.passing_options}") . "\n\n";140 print STDERR &lookup_string("{pluginfo.option_types}") . ":\n\n";141 print STDERR &lookup_string("{pluginfo.specific_options}") . "\n\n";142 print STDERR &lookup_string("{pluginfo.general_options}") . "\n\n";105 &gsprintf(STDERR, "\n$plugin {pluginfo.info}:\n\n"); 106 &gsprintf(STDERR, "{pluginfo.passing_options}\n\n"); 107 &gsprintf(STDERR, "{pluginfo.option_types}:\n\n"); 108 &gsprintf(STDERR, "{pluginfo.specific_options}\n\n"); 109 &gsprintf(STDERR, "{pluginfo.general_options}\n\n"); 143 110 144 111 $plugobj->print_txt_usage($language); … … 155 122 $pid = open(STDIN, "-|"); # this does a fork... see man perlipc(1) 156 123 if (!defined $pid) { 157 print STDERR "pluginfo.pl - can't fork: $!";124 &gsprintf(STDERR, "pluginfo.pl - can't fork: $!"); 158 125 } else { 159 126 if ($pid != 0) { # parent (ie forking) process. child gets 0
Note:
See TracChangeset
for help on using the changeset viewer.