Changeset 6988
- Timestamp:
- 2004-03-09T16:16:28+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/pluginfo.pl
r6945 r6988 28 28 # This program will print info about a plugin 29 29 30 # @revision 09/05/02 Added XML usage information flag - John Thompson 30 use strict; 31 no strict 'subs'; # allow barewords (eg STDERR) as function arguments 31 32 32 33 BEGIN { … … 73 74 my $xml = 0; 74 75 76 my $language; 77 75 78 if (!parsargv::parse(\@ARGV, 76 79 q^collect/.*/^, \$collect, … … 78 81 q^language/.*/^, \$language)) 79 82 { 80 &PrintUsage::print_txt_usage($options, "{pluginfo.params}", 1);83 PrintUsage::print_txt_usage($options, "{pluginfo.params}", 1); 81 84 die "\n"; 82 85 } 83 86 84 # If $language has been specified, load the appropriate resource bundle 87 # if language wasn't specified, see if it is set in the environment 88 # (LC_ALL or LANG) 89 if (!$language && ($_=$ENV{'LC_ALL'} or $_=$ENV{'LANG'})) { 90 m/^([^\.]+)\.?(.*)/; 91 $language=$1; 92 # gsprintf doesn't do anything about encoding, hard-coded to iso-8859-1!! 93 # my $encoding=$2; # might be undef... 94 # gsprintf::load_language* thinks "fr" is completely different to "fr_FR"... 95 $language =~ s/_.*$//; 96 } 97 98 # If $language has been set, load the appropriate resource bundle 85 99 # (Otherwise, the default resource bundle will be loaded automatically) 86 100 if ($language) { 87 &gsprintf::load_language_specific_resource_bundle($language);101 gsprintf::load_language_specific_resource_bundle($language); 88 102 } 89 103 90 104 my $plugin = shift (@ARGV); 91 105 if (!defined $plugin || $plugin eq "") { 92 &gsprintf(STDERR, "{pluginfo.no_plugin_name}\n\n");93 &PrintUsage::print_txt_usage($options, "{pluginfo.params}", 1);106 gsprintf(STDERR, "{pluginfo.no_plugin_name}\n\n"); 107 PrintUsage::print_txt_usage($options, "{pluginfo.params}", 1); 94 108 die "\n"; 95 109 } … … 108 122 } 109 123 else { 110 &gsprintf(STDERR, "\n{pluginfo.passing_options}\n\n");111 &gsprintf(STDERR, "{pluginfo.option_types}:\n\n");112 &gsprintf(STDERR, "{pluginfo.specific_options}\n\n");113 &gsprintf(STDERR, "{pluginfo.general_options}\n\n");114 &gsprintf(STDERR, "$plugin {pluginfo.info}:\n\n");124 gsprintf(STDERR, "\n{pluginfo.passing_options}\n\n"); 125 gsprintf(STDERR, "{pluginfo.option_types}:\n\n"); 126 gsprintf(STDERR, "{pluginfo.specific_options}\n\n"); 127 gsprintf(STDERR, "{pluginfo.general_options}\n\n"); 128 gsprintf(STDERR, "$plugin {pluginfo.info}:\n\n"); 115 129 116 130 $plugobj->print_txt_usage(); … … 125 139 my $pager = $ENV{"PAGER"}; 126 140 if (! $pager) {$pager="(less || more)"} 127 $pid = open(STDIN, "-|"); # this does a fork... see man perlipc(1)141 my $pid = open(STDIN, "-|"); # this does a fork... see man perlipc(1) 128 142 if (!defined $pid) { 129 &gsprintf(STDERR, "pluginfo.pl - can't fork: $!");143 gsprintf(STDERR, "pluginfo.pl - can't fork: $!"); 130 144 } else { 131 145 if ($pid != 0) { # parent (ie forking) process. child gets 0
Note:
See TracChangeset
for help on using the changeset viewer.