--- Perldoc.pm-3.14 2005-07-24 13:11:09.000000000 +0200 +++ Perldoc.pm 2005-07-25 08:04:45.000000000 +0200 @@ -62,7 +62,7 @@ # # Option accessors... -foreach my $subname (map "opt_$_", split '', q{mhlvriFfXqnTdU}) { +foreach my $subname (map "opt_$_", split '', q{mhlvriFfXqnTdUL}) { no strict 'refs'; *$subname = do{ use strict 'refs'; sub () { shift->_elem($subname, @_) } }; } @@ -71,6 +71,7 @@ sub opt_f_with { shift->_elem('opt_f', @_) } sub opt_q_with { shift->_elem('opt_q', @_) } sub opt_d_with { shift->_elem('opt_d', @_) } +sub opt_L_with { shift->_elem('opt_L', @_) } sub opt_w_with { # Specify an option for the formatter subclass my($self, $value) = @_; @@ -258,6 +259,7 @@ -o output_format_name -M FormatterModuleNameToUse -w formatter_option:option_value + -L translation_code Choose doc translation (if any) -X use index if present (looks for pod.idx at $Config{archlib}) -q Search the text of questions (not answers) in perlfaq[1-9] @@ -291,7 +293,7 @@ $me =~ s,.*[/\\],,; # get basename die <<"EOUSAGE"; -Usage: $me [-h] [-V] [-r] [-i] [-v] [-t] [-u] [-m] [-n nroffer_program] [-l] [-T] [-d output_filename] [-o output_format] [-M FormatterModuleNameToUse] [-w formatter_option:option_value] [-F] [-X] PageName|ModuleName|ProgramName +Usage: $me [-h] [-V] [-r] [-i] [-v] [-t] [-u] [-m] [-n nroffer_program] [-l] [-T] [-d output_filename] [-o output_format] [-M FormatterModuleNameToUse] [-w formatter_option:option_value] [-L translation_code] [-F] [-X] PageName|ModuleName|ProgramName $me -f PerlFunc $me -q FAQKeywords @@ -417,6 +419,12 @@ return $self->usage_brief unless @pages; + # Adjusts pages for translation packages + if ( $self->opt_L ) { + eval "require POD2::" . uc($self->opt_L); + @pages = map { 'POD2::' . uc($self->opt_L) . '::' . $_ } @pages if ! $@; + } + $self->find_good_formatter_class(); $self->formatter_sanity_check(); @@ -817,11 +825,17 @@ DEBUG > 2 and print "Going to perlfunc-scan for $search_re in $perlfunc\n"; - + + my $re = 'Alphabetical Listing of Perl Functions'; + if ( $self->opt_L ) { + my $code = 'POD2::' . uc($self->opt_L); + $re = $code->search_perlfunc_re if $code->can('search_perlfunc_re'); + } + # Skip introduction local $_; while () { - last if /^=head2 Alphabetical Listing of Perl Functions/; + last if /^=head2 $re/; } # Look for our function