From b42210d7e8be170d487d1f438e31efc8ddff8cd7 Mon Sep 17 00:00:00 2001 From: Rajesh Vaidheeswarran Date: Tue, 17 Apr 2001 05:35:00 -0400 Subject: [PATCH] Fwd: pod2html leaves cache files lying around? Message-Id: p4raw-id: //depot/perl@9743 --- lib/Pod/Html.pm | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/Pod/Html.pm b/lib/Pod/Html.pm index 4316823..e61f29a 100644 --- a/lib/Pod/Html.pm +++ b/lib/Pod/Html.pm @@ -43,6 +43,12 @@ Pod::Html takes the following arguments: Adds "Back to Top" links in front of every HEAD1 heading (except for the first). By default, no backlink are being generated. +=item cachedir + + --cachedir=name + +Creates the item and directory caches in the given directory. + =item css --css=stylesheet @@ -194,6 +200,8 @@ This program is distributed under the Artistic License. =cut +my $cachedir = "."; # The directory to which item and directory + # caches will be written. my $cache_ext = $^O eq 'VMS' ? ".tmp" : ".x~~"; my $dircache = "pod2htmd$cache_ext"; my $itemcache = "pod2htmi$cache_ext"; @@ -565,9 +573,10 @@ $usage =< --infile= --outfile= --podpath=:...: --podroot= --libpods=:...: --recurse --verbose --index - --netscape --norecurse --noindex + --netscape --norecurse --noindex --cachedir= --backlink - set text for "back to top" links (default: none). + --cachedir - directory for the item and directory cache files. --css - stylesheet URL --flush - flushes the item and directory caches. --[no]header - produce block header/footer (default is no headers). @@ -600,14 +609,15 @@ Usage: $0 --help --htmlroot= --infile= --outfile= END_OF_USAGE sub parse_command_line { - my ($opt_backlink,$opt_css,$opt_flush,$opt_header,$opt_help,$opt_htmldir, - $opt_htmlroot,$opt_index,$opt_infile,$opt_libpods,$opt_netscape, - $opt_outfile,$opt_podpath,$opt_podroot,$opt_quiet,$opt_recurse, - $opt_title,$opt_verbose); + my ($opt_backlink,$opt_cachedir,$opt_css,$opt_flush,$opt_header,$opt_help, + $opt_htmldir,$opt_htmlroot,$opt_index,$opt_infile,$opt_libpods, + $opt_netscape,$opt_outfile,$opt_podpath,$opt_podroot,$opt_quiet, + $opt_recurse,$opt_title,$opt_verbose); unshift @ARGV, split ' ', $Config{pod2html} if $Config{pod2html}; my $result = GetOptions( 'backlink=s' => \$opt_backlink, + 'cachedir=s' => \$opt_cachedir, 'css=s' => \$opt_css, 'flush' => \$opt_flush, 'header!' => \$opt_header, @@ -635,6 +645,7 @@ sub parse_command_line { @libpods = split(":", $opt_libpods) if defined $opt_libpods; $backlink = $opt_backlink if defined $opt_backlink; + $cachedir = $opt_cachedir if defined $opt_cachedir; $css = $opt_css if defined $opt_css; $header = $opt_header if defined $opt_header; $htmldir = $opt_htmldir if defined $opt_htmldir; @@ -651,6 +662,8 @@ sub parse_command_line { warn "Flushing item and directory caches\n" if $opt_verbose && defined $opt_flush; + $dircache = "$cachedir/pod2htmd$cache_ext"; + $itemcache = "$cachedir/pod2htmi$cache_ext"; unlink($dircache, $itemcache) if defined $opt_flush; } -- 2.7.4