X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=installhtml;h=fe6628d476791687fd9cfb30dfae40b73fb0c185;hb=f224927c1e379a33cd6d5e0a5d25d0ecb9c9d964;hp=4bbaba9f0de157ab17b90b6e8fe5c76f31840140;hpb=7c82de66cbf5ee61be1c86c3c35fa10f7cc6d075;p=p5sagit%2Fp5-mst-13.2.git diff --git a/installhtml b/installhtml index 4bbaba9..fe6628d 100755 --- a/installhtml +++ b/installhtml @@ -167,12 +167,10 @@ usage("") unless @ARGV; # See vms/descrip_mms.template -> descrip.mms for invokation. if ( $^O eq 'VMS' ) { @ARGV = split(/\s+/,$ARGV[0]); } -use vars qw($opt_htmldir $opt_htmlroot $opt_podroot $opt_splitpod - $opt_verbose $opt_help $opt_podpath $opt_splithead $opt_splititem - $opt_libpods $opt_recurse); +use vars qw( %Options ); # parse the command-line -my $result = GetOptions( qw( +my $result = GetOptions( \%Options, qw( help podpath=s podroot=s @@ -249,7 +247,7 @@ foreach my $dir (@splithead) { $_ =~ s{HREF="#(.*)">}{ my $url = "$file/$1.html" ; $url = Pod::Html::relativize_url( $url, "$file.html" ) - if ( ! defined $opt_htmlroot || $opt_htmlroot eq '' ) ; + if ( ! defined $Options{htmlroot} || $Options{htmlroot} eq '' ); "HREF=\"$url\">" ; }eg; push @data, $_; @@ -273,24 +271,24 @@ sub usage { sub parse_command_line { - usage() if defined $opt_help; - $opt_help = ""; # make -w shut up + usage() if defined $Options{help}; + $Options{help} = ""; # make -w shut up # list of directories - @podpath = split(":", $opt_podpath) if defined $opt_podpath; + @podpath = split(":", $Options{podpath}) if defined $Options{podpath}; # lists of files - @splithead = split(",", $opt_splithead) if defined $opt_splithead; - @splititem = split(",", $opt_splititem) if defined $opt_splititem; - @libpods = split(",", $opt_libpods) if defined $opt_libpods; + @splithead = split(",", $Options{splithead}) if defined $Options{splithead}; + @splititem = split(",", $Options{splititem}) if defined $Options{splititem}; + @libpods = split(",", $Options{libpods}) if defined $Options{libpods}; - $htmldir = $opt_htmldir if defined $opt_htmldir; - $htmlroot = $opt_htmlroot if defined $opt_htmlroot; - $podroot = $opt_podroot if defined $opt_podroot; - $splitpod = $opt_splitpod if defined $opt_splitpod; + $htmldir = $Options{htmldir} if defined $Options{htmldir}; + $htmlroot = $Options{htmlroot} if defined $Options{htmlroot}; + $podroot = $Options{podroot} if defined $Options{podroot}; + $splitpod = $Options{splitpod} if defined $Options{splitpod}; - $recurse = $opt_recurse if defined $opt_recurse; - $verbose = $opt_verbose if defined $opt_verbose; + $recurse = $Options{recurse} if defined $Options{recurse}; + $verbose = $Options{verbose} if defined $Options{verbose}; } @@ -337,7 +335,7 @@ sub create_index { ($lcp1,$lcp2) = ($name =~ m,/H1>\s

\s(\S+)\s[\s-]*(.*?)\s*$,sm); } my $url= "$dir/$file" ; - if ( ! defined $opt_htmlroot || $opt_htmlroot eq '' ) { + if ( ! defined $Options{htmlroot} || $Options{htmlroot} eq '' ) { $url = Pod::Html::relativize_url( "$dir/$file", $html ) ; }