Changeset 3541
- Timestamp:
- 2002-11-18T17:44:39+13:00 (21 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/classinfo.pl
r2785 r3541 48 48 print STDERR " first. If it doesn't find it there it will look in the general\n"; 49 49 print STDERR " perllib/classify directory.\n\n"; 50 print STDERR " -xml Produces the information in an xml form, without\n"; 51 print STDERR " 'pretty' comments but with much more detail.\n"; 50 52 } 51 53 … … 54 56 sub main { 55 57 my $collect = ""; 58 my $xml = 0; 56 59 57 60 # Parse command line 58 if (!parsargv::parse(\@ARGV, 'collect.*/', \$collect)) { 59 &print_usage(); 60 die "\n"; 61 if (!parsargv::parse(\@ARGV, q^collect/.*/^, \$collect, q^xml^, \$xml )) 62 { 63 &print_usage(); 64 die "\n"; 61 65 } 62 66 … … 64 68 my $classifier = shift (@ARGV); 65 69 if (!defined $classifier || $classifier eq "") { 66 print STDERR "You must provide a classifier name\n";67 &print_usage();68 die "\n";70 print STDERR "You must provide a classifier name\n"; 71 &print_usage(); 72 die "\n"; 69 73 } 70 74 71 75 # make sure the classifier is loaded from the correct location - a hack. 72 76 if ($collect ne "") { 73 $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collect);77 $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collect); 74 78 } else { 75 $ENV{'GSDLCOLLECTDIR'} = $ENV{'GSDLHOME'};79 $ENV{'GSDLCOLLECTDIR'} = $ENV{'GSDLHOME'}; 76 80 } 77 81 78 82 my $classinfo = &classify::load_classifiers ([[$classifier]]); 79 83 my $classobj = shift @$classinfo; 80 84 81 print STDERR " 85 if ($xml) 86 { 87 $classobj->print_xml_usage(); 88 } 89 else 90 { 91 print STDERR " 82 92 $classifier info: 83 93 … … 95 105 $classifier takes the following specific options: 96 106 "; 97 107 $classobj->print_usage(); 98 108 99 109 print STDERR "$classifier takes the following general options 100 110 "; 101 102 111 &BasClas::print_general_usage($classifier); 112 } 103 113 } 104 114 -
trunk/gsdl/bin/script/pluginfo.pl
r2785 r3541 26 26 ########################################################################### 27 27 28 # This program will print info about a plugin 28 29 29 # This program will print info about a plugin30 # @revision 09/05/02 Added XML usage information flag - John Thompson 30 31 31 32 BEGIN { … … 49 50 print STDERR " for plugin first. If it doesn't find it there\n"; 50 51 print STDERR " it will look in the general perllib/plugins\n"; 51 print STDERR " directory\n\n"; 52 print STDERR " directory\n"; 53 print STDERR " -xml Produces the information in an xml form, without\n"; 54 print STDERR " 'pretty' comments but with much more detail.\n"; 52 55 } 53 56 … … 57 60 sub main { 58 61 my $collect = ""; 59 if (!parsargv::parse(\@ARGV, 'collect.*/', \$collect)) { 60 &print_usage(); 61 die "\n"; 62 } 62 my $xml = 0; 63 64 if (!parsargv::parse(\@ARGV, q^collect/.*/^, \$collect, q^xml^, \$xml )) 65 { 66 &print_usage(); 67 die "\n"; 68 } 63 69 64 70 my $plugin = shift (@ARGV); 65 71 if (!defined $plugin || $plugin eq "") { 66 print STDERR "You must provide a plugin name\n";67 &print_usage();68 die "\n";72 print STDERR "You must provide a plugin name\n"; 73 &print_usage(); 74 die "\n"; 69 75 } 70 76 71 77 if ($collect ne "") { 72 $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collect);78 $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collect); 73 79 } else { 74 $ENV{'GSDLCOLLECTDIR'} = $ENV{'GSDLHOME'};80 $ENV{'GSDLCOLLECTDIR'} = $ENV{'GSDLHOME'}; 75 81 } 76 82 77 my $pluginfo = &plugin::load_plugins ([[$plugin]]); 83 my $pluginfo = &plugin::load_plugins ([[$plugin]]); 84 85 my $plugobj = shift @$pluginfo; 78 86 79 my $plugobj = shift @$pluginfo; 87 if ($xml) { 88 $plugobj->print_xml_usage(); 89 } 90 else 91 { 92 my $pluginfo = &plugin::load_plugins ([[$plugin]]); 93 94 my $plugobj = shift @$pluginfo; 95 96 print STDERR "\n$plugin info:\n\n"; 97 98 print STDERR "Options may be passed to any plugin by including them in your collect.cfg\n"; 99 print STDERR "configuration file.\n\n"; 100 101 print STDERR "Plugins may take two types of options:\n\n"; 102 103 print STDERR "General options are defined within the base class (BasPlug.pm) and are\n"; 104 print STDERR "inherited by any plugin that has been correctly derived from BasPlug.\n\n"; 80 105 81 print STDERR "\n$plugin info:\n\n"; 82 83 print STDERR "Options may be passed to any plugin by including them in your collect.cfg\n"; 84 print STDERR "configuration file.\n\n"; 85 86 print STDERR "Plugins may take two types of options:\n\n"; 87 88 print STDERR "General options are defined within the base class (BasPlug.pm) and are\n"; 89 print STDERR "inherited by any plugin that has been correctly derived from BasPlug.\n\n"; 90 91 print STDERR "Specific options are defined within the plugin itself and are available\n"; 92 print STDERR "only to this particular plugin.\n\n"; 93 94 print STDERR "$plugin takes the following specific options:\n"; 95 $plugobj->print_usage(); 96 97 print STDERR "$plugin takes the following general options\n"; 98 &BasPlug::print_general_usage($plugin); 99 100 print STDERR "The default process_exp for $plugin is\n"; 101 print STDERR "\"" . $plugobj->get_default_process_exp() . "\"\n\n"; 102 103 print STDERR "The default block_exp for $plugin is\n"; 104 print STDERR "\"" . $plugobj->get_default_block_exp() . "\"\n\n"; 105 106 print STDERR "Specific options are defined within the plugin itself and are available\n"; 107 print STDERR "only to this particular plugin.\n\n"; 108 109 print STDERR "$plugin takes the following specific options:\n"; 110 111 $plugobj->print_usage(); 112 113 print STDERR "$plugin takes the following general options\n"; 114 &BasPlug::print_general_usage($plugin); 115 116 print STDERR "The default process_exp for $plugin is\n"; 117 print STDERR "\"" . $plugobj->get_default_process_exp() . "\"\n\n"; 118 119 print STDERR "The default block_exp for $plugin is\n"; 120 print STDERR "\"" . $plugobj->get_default_block_exp() . "\"\n\n"; 121 } 106 122 } 107 123
Note:
See TracChangeset
for help on using the changeset viewer.