Ignore:
Timestamp:
2002-11-18T17:43:56+13:00 (21 years ago)
Author:
kjdon
Message:

added John T's changes into CVS - added info to enable retrieval of usage info in xml

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/TEXTPlug.pm

    r3037 r3540  
    2727# of first line of text (up to 100 characters long).
    2828
     29# 12/05/02 Added usage datastructure - John Thompson
     30
    2931package TEXTPlug;
    3032
     
    3638    @ISA = ('BasPlug');
    3739}
     40
     41my $arguments = [ { 'name' => "process_exp",
     42                          'desc' => "A perl regular expression to match against filenames. Matching filenames will be processed by this plugin. Each plugin has its own default process_exp. e.g HTMLPlug defaults to '(?i)\.html?\$' i.e. all documents ending in .htm or .html (case-insensitive).",
     43                          'type' => "string",
     44                          'deft' => q^(?i)\.te?xt$^,
     45                          'reqd' => "no" } ,
     46                        { 'name' => "title_sub",
     47                          'desc' => "Substitution expression to modify string stored as Title. Used by, for example, PSPlug to remove \"Page 1\" etc from text used as the title.",
     48                          'type' => "string",
     49                          'reqd' => "no" }];
     50
     51my $options = { 'name'     => "TEXTPlug",
     52                 'desc'     => "Creates simple single-level document. Adds Title metadata of first line of text (up to 100 characters long).",
     53                     'inherits' => "yes",
     54                     'args'     => $arguments };
    3855
    3956sub print_usage {
     
    5067    my ($class) = @_;
    5168    my $self = new BasPlug ($class, @_);
     69
     70     # 14-05-02 To allow for proper inheritance of arguments - John Thompson
     71     my $option_list = $self->{'option_list'};
     72     push( @{$option_list}, $options );
    5273
    5374    if (!parsargv::parse(\@_,
     
    87108    $title =~ /^\s+/s;
    88109    if (defined $self->{'title_sub'} &&
    89         $self->{'title_sub'}) {$title =~ s/$self->{'title_sub'}//;}
     110           $self->{'title_sub'}) {$title =~ s/$self->{'title_sub'}//;}
    90111    $title =~ /^\s*([^\n]*)/s; $title=$1;
    91112    if (length($title) > 100) {
Note: See TracChangeset for help on using the changeset viewer.