Ignore:
Timestamp:
2003-06-20T14:22:34+12:00 (21 years ago)
Author:
mdewsnip
Message:

Tidied up and structures (representing the options of the plugin) in preparation for removing the print_usage() routines.

File:
1 edited

Legend:

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

    r3932 r4744  
    3939}
    4040
    41 my $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" }];
     41my $arguments =
     42    [ { 'name' => "process_exp",
     43    'desc' => "A perl regular expression to match against filenames. Matching filenames will be processed by this plugin. For example, using '(?i).html?\$' matches all documents ending in .htm or .html (case-insensitive).",
     44    'type' => "string",
     45    'deft' => &get_default_process_exp(),
     46    'reqd' => "no" } ,
     47      { 'name' => "title_sub",
     48    '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.",
     49    'type' => "string",
     50    'deft' => "",
     51    'reqd' => "no" } ];
    5052
    5153my $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 };
     54        'desc'     => "Creates simple single-level document. Adds Title metadata of first line of text (up to 100 characters long).",
     55        'inherits' => "yes",
     56        'args'     => $arguments };
    5557
    5658sub print_usage {
     
    6870    my $self = new BasPlug ($class, @_);
    6971
    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 );
     72    # 14-05-02 To allow for proper inheritance of arguments - John Thompson
     73    my $option_list = $self->{'option_list'};
     74    push( @{$option_list}, $options );
    7375
    7476    if (!parsargv::parse(\@_,
Note: See TracChangeset for help on using the changeset viewer.