source: trunk/gsdl/bin/script/pluginfo.pl@ 1970

Last change on this file since 1970 was 1970, checked in by sjboddie, 23 years ago

Added more usage information to all perl programs and removed a few
programs that are no longer useful.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1#!/usr/bin/perl -w
2
3###########################################################################
4#
5# pluginfo.pl --
6# A component of the Greenstone digital library software
7# from the New Zealand Digital Library Project at the
8# University of Waikato, New Zealand.
9#
10# Copyright (C) 1999 New Zealand Digital Library Project
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25#
26###########################################################################
27
28
29# This program will print info about a plugin
30
31BEGIN {
32 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
33 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
34 unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
35 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/plugins");
36}
37
38use strict;
39use plugin;
40use util;
41use parsargv;
42
43sub print_usage {
44 print STDERR "\n";
45 print STDERR "pluginfo.pl: Prints information about a plugin.\n\n";
46 print STDERR " usage: $0 [options] plugin\n\n";
47 print STDERR " options:\n";
48 print STDERR " -collect collection-name Giving a collection name will make pluginfo.pl\n";
49 print STDERR " look in collect/collection-name/perllib/plugins\n";
50 print STDERR " for plugin first. If it doesn't find it there\n";
51 print STDERR " it will look in the general perllib/plugins\n";
52 print STDERR " directory\n\n";
53}
54
55
56&main ();
57
58sub main {
59 my $collect = "";
60 if (!parsargv::parse(\@ARGV, 'collect.*/', \$collect)) {
61 &print_usage();
62 die "\n";
63 }
64
65 my $plugin = shift (@ARGV);
66 if (!defined $plugin || $plugin eq "") {
67 print STDERR "You must provide a plugin name\n";
68 &print_usage();
69 die "\n";
70 }
71
72 if ($collect ne "") {
73 $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collect);
74 } else {
75 $ENV{'GSDLCOLLECTDIR'} = $ENV{'GSDLHOME'};
76 }
77
78 my $pluginfo = &plugin::load_plugins ([[$plugin]]);
79
80 my $plugobj = shift @$pluginfo;
81
82 print STDERR "\n$plugin info:\n\n";
83
84 print STDERR "Options may be passed to any plugin by including them in your collect.cfg\n";
85 print STDERR "configuration file.\n\n";
86
87 print STDERR "Plugins may take two types of options:\n\n";
88
89 print STDERR "General options are defined within the base class (BasPlug.pm) and are\n";
90 print STDERR "inherited by any plugin that has been correctly derived from BasPlug.\n\n";
91
92 print STDERR "Specific options are defined within the plugin itself and are available\n";
93 print STDERR "only to this particular plugin.\n\n";
94
95 print STDERR "$plugin takes the following specific options:\n";
96 $plugobj->print_usage();
97
98 print STDERR "$plugin takes the following general options\n";
99 &BasPlug::print_general_usage($plugin);
100
101 print STDERR "The default process_exp for $plugin is\n";
102 print STDERR "\"" . $plugobj->get_default_process_exp() . "\"\n\n";
103
104 print STDERR "The default block_exp for $plugin is\n";
105 print STDERR "\"" . $plugobj->get_default_block_exp() . "\"\n\n";
106
107}
108
Note: See TracBrowser for help on using the repository browser.