Perl style fixes, document more Perl programs

This commit is contained in:
Andrew Johnson
2015-04-21 15:09:24 -05:00
parent fa23ba8a6a
commit e4f336de94
21 changed files with 259 additions and 112 deletions
+2 -2
View File
@@ -32,8 +32,8 @@ our $opt_o = 'envData.c';
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
$Text::Wrap::columns = 75;
&HELP_MESSAGE unless getopts('ho:q') && @ARGV == 1;
&HELP_MESSAGE if $opt_h;
HELP_MESSAGE() unless getopts('ho:q') && @ARGV == 1;
HELP_MESSAGE() if $opt_h;
my $config = AbsPath(shift);
my $env_defs = AbsPath('../env/envDefs.h');
+2 -2
View File
@@ -20,8 +20,8 @@ our $opt_o = 'epicsVersion.h';
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
&HELP_MESSAGE unless getopts('ho:qv:') && @ARGV == 1;
&HELP_MESSAGE if $opt_h;
HELP_MESSAGE() unless getopts('ho:qv:') && @ARGV == 1;
HELP_MESSAGE() if $opt_h;
my ($infile) = @ARGV;
+13 -13
View File
@@ -20,10 +20,10 @@ $app_top = cwd();
$bad_ident_chars = '[^0-9A-Za-z_]';
&readReleaseFiles("configure/RELEASE", \%release, \@apps);
&expandRelease(\%release);
&get_commandline_opts; # Check command-line options
&GetUser; # Ensure we know who's in charge
readReleaseFiles("configure/RELEASE", \%release, \@apps);
expandRelease(\%release);
get_commandline_opts(); # Check command-line options
GetUser(); # Ensure we know who's in charge
#
# Declare two default callback routines for file copy plus two
@@ -86,7 +86,7 @@ sub ReplaceFilename { # (filename)
$file =~ s|_APPTYPE_|$apptype|;
my $qmtop = quotemeta($top);
$file =~ s|$qmtop/||; # Change to the target location
$file = &ReplaceFilenameHook($file); # Call the apptype's hook
$file = ReplaceFilenameHook($file); # Call the apptype's hook
return $file;
}
@@ -104,7 +104,7 @@ sub ReplaceLine { # (line)
$line =~ s/_CSAFEAPPNAME_/$csafeappname/g;
$line =~ s/_APPTYPE_/$apptype/go;
$line =~ s/_ARCH_/$arch/go if ($opt_i);
$line = &ReplaceLineHook($line); # Call the apptype's hook
$line = ReplaceLineHook($line); # Call the apptype's hook
return $line;
}
@@ -202,7 +202,7 @@ sub get_commandline_opts { #no args
# Print application type list?
if ($opt_l) {
&ListAppTypes;
ListAppTypes();
exit 0; # finished for -l command
}
@@ -325,7 +325,7 @@ sub ListAppTypes { # no args
#
sub CopyFile { # (source)
$source = $_[0];
$target = &ReplaceFilename($source);
$target = ReplaceFilename($source);
if ($target and !-e $target) {
open(INP, "<$source") and open(OUT, ">$target")
@@ -333,7 +333,7 @@ sub CopyFile { # (source)
print "Copying file $source -> $target\n" if $opt_d;
while (<INP>) {
print OUT &ReplaceLine($_);
print OUT ReplaceLine($_);
}
close INP; close OUT;
}
@@ -345,11 +345,11 @@ sub CopyFile { # (source)
sub FCopyTree {
chdir $app_top; # Sigh
if (-d "$File::Find::name"
and ($dir = &ReplaceFilename($File::Find::name))) {
and ($dir = ReplaceFilename($File::Find::name))) {
print "Creating directory $dir\n" if $opt_d;
&mkpath($dir) unless (-d "$dir");
mkpath($dir) unless (-d "$dir");
} else {
&CopyFile($File::Find::name);
CopyFile($File::Find::name);
}
chdir $File::Find::dir;
}
@@ -363,7 +363,7 @@ sub Cleanup { # (return-code [ messsage-line1, line 2, ... ])
if (@message) {
print join("\n", @message), "\n";
} else {
&Usage;
Usage();
}
exit $rtncode;
}
+11 -11
View File
@@ -15,7 +15,7 @@ $eEXTTYPE = $ENV{EPICS_MBE_DEF_EXT_TYPE};
$eTOP = $ENV{EPICS_MBE_TEMPLATE_TOP};
$eBASE = $ENV{EPICS_MBE_BASE};
&get_commandline_opts; # Read and check options
get_commandline_opts(); # Read and check options
$extname = "@ARGV";
@@ -43,7 +43,7 @@ sub ReplaceFilename { # (filename)
$file =~ s|_EXTTYPE_|$exttype|;
# We don't want the Replace overrides
$file =~ s|.*/$extdir/Replace.pl$||;
$file = &ReplaceFilenameHook($file); # Call the user-defineable hook
$file = ReplaceFilenameHook($file); # Call the user-defineable hook
return $file;
}
@@ -58,7 +58,7 @@ sub ReplaceLine { # (line)
$line =~ s/_EXTNAME_/$extname/o;
$line =~ s/_EXTTYPE_/$exttype/o;
$line =~ s/_TEMPLATE_TOP_/$top/o;
$line = &ReplaceLineHook($line); # Call the user-defineable hook
$line = ReplaceLineHook($line); # Call the user-defineable hook
return $line;
}
@@ -73,7 +73,7 @@ if (-r "$top/$exttypename/Replace.pl") {
opendir TOPDIR, "$top" or die "Can't open $top: $!";
foreach $f ( grep !/^\.\.?$|^[^\/]*(Ext)/, readdir TOPDIR ) {
if (-f "$f") {
&CopyFile("$top/$f") unless (-e "$f");
CopyFile("$top/$f") unless (-e "$f");
} else {
$note = yes if ("$f" eq "src" && -e "$f");
find(\&FCopyTree, "$top/$f") unless (-e "$f");
@@ -154,7 +154,7 @@ sub get_commandline_opts { #no args
# Print extension type list?
if ($opt_l) {
&ListExtTypes;
ListExtTypes();
exit 0; # finished for -l command
}
@@ -175,7 +175,7 @@ sub get_commandline_opts { #no args
# Valid $exttypename?
unless (-r "$top/$exttypename") {
print "Template for extension type '$exttype' is unreadable or does not exist.\n";
&ListExtTypes;
ListExtTypes();
exit 1;
}
@@ -204,7 +204,7 @@ sub ListExtTypes { # no args
#
sub CopyFile { # (source)
$source = $_[0];
$target = &ReplaceFilename($source);
$target = ReplaceFilename($source);
if ($target) {
$target =~ s|$top/||;
@@ -213,7 +213,7 @@ sub CopyFile { # (source)
print "Copying file $source -> $target\n" if $Debug;
while (<INP>) {
print OUT &ReplaceLine($_);
print OUT ReplaceLine($_);
}
close INP; close OUT;
}
@@ -225,12 +225,12 @@ sub CopyFile { # (source)
sub FCopyTree {
chdir $cwd; # Sigh
if (-d $File::Find::name
and ($dir = &ReplaceFilename($File::Find::name))) {
and ($dir = ReplaceFilename($File::Find::name))) {
$dir =~ s|$top/||;
print "Creating directory $dir\n" if $Debug;
&mkpath($dir);
mkpath($dir);
} else {
&CopyFile($File::Find::name);
CopyFile($File::Find::name);
}
chdir $File::Find::dir;
}
+7 -7
View File
@@ -19,13 +19,13 @@ use DBD::Variable;
sub OutputDBD {
my ($out, $dbd) = @_;
&OutputMenus($out, $dbd->menus);
&OutputRecordtypes($out, $dbd->recordtypes);
&OutputDrivers($out, $dbd->drivers);
&OutputRegistrars($out, $dbd->registrars);
&OutputFunctions($out, $dbd->functions);
&OutputVariables($out, $dbd->variables);
&OutputBreaktables($out, $dbd->breaktables);
OutputMenus($out, $dbd->menus);
OutputRecordtypes($out, $dbd->recordtypes);
OutputDrivers($out, $dbd->drivers);
OutputRegistrars($out, $dbd->registrars);
OutputFunctions($out, $dbd->functions);
OutputVariables($out, $dbd->variables);
OutputBreaktables($out, $dbd->breaktables);
}
sub OutputMenus {
+1 -1
View File
@@ -79,7 +79,7 @@ sub parseCommon {
# Extract POD
if (m/\G ( = [a-zA-Z] .* ) \n/oxgc) {
$obj->add_pod($1, &parsePod);
$obj->add_pod($1, parsePod());
}
elsif (m/\G \# /oxgc) {
if (m/\G \# ! BEGIN \{ ( [^}]* ) \} ! \# \# \n/oxgc) {
+7 -7
View File
@@ -145,25 +145,25 @@ complete set of dependencies for the input file.
sub Readfile {
my ($file, $macros, $Rpath) = @_;
print "Readfile($file)\n" if $debug;
my $input = &expandMacros($macros, &slurp($file, $Rpath));
my $input = expandMacros($macros, slurp($file, $Rpath));
my @input = split /\n/, $input;
my @output;
foreach (@input) {
if (m/^ \s* include \s+ $string /ox) {
$arg = &unquote($1);
$arg = unquote($1);
print " include $arg\n" if $debug;
push @output, "##! include \"$arg\"";
push @output, &Readfile($arg, $macros, $Rpath);
push @output, Readfile($arg, $macros, $Rpath);
} elsif (m/^ \s* addpath \s+ $string /ox) {
$arg = &unquote($1);
$arg = unquote($1);
print " addpath $arg\n" if $debug;
push @output, "##! addpath \"$arg\"";
push @{$Rpath}, &splitPath($arg);
push @{$Rpath}, splitPath($arg);
} elsif (m/^ \s* path \s+ $string /ox) {
$arg = &unquote($1);
$arg = unquote($1);
print " path $arg\n" if $debug;
push @output, "##! path \"$arg\"";
@{$Rpath} = &splitPath($arg);
@{$Rpath} = splitPath($arg);
} else {
push @output, $_;
}
+6 -6
View File
@@ -19,22 +19,22 @@ sub readReleaseFiles {
$Rmacros->{'EPICS_HOST_ARCH'} = $hostarch if $hostarch;
return unless (-e $relfile);
&readRelease($relfile, $Rmacros, $Rapps);
readRelease($relfile, $Rmacros, $Rapps);
if ($hostarch) {
my $hrelfile = "$relfile.$hostarch";
&readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile);
readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile);
$hrelfile .= '.Common';
&readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile);
readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile);
}
if ($arch) {
my $crelfile = "$relfile.Common.$arch";
&readRelease($crelfile, $Rmacros, $Rapps) if (-e $crelfile);
readRelease($crelfile, $Rmacros, $Rapps) if (-e $crelfile);
if ($hostarch) {
my $arelfile = "$relfile.$hostarch.$arch";
&readRelease($arelfile, $Rmacros, $Rapps) if (-e $arelfile);
readRelease($arelfile, $Rmacros, $Rapps) if (-e $arelfile);
}
}
}
@@ -71,7 +71,7 @@ sub readRelease {
my ($op, $path) = m/^ \s* (-? include) \s+ (.*)/x;
$path = expandMacros($path, $Rmacros);
if (-e $path) {
&readRelease($path, $Rmacros, $Rapps);
readRelease($path, $Rmacros, $Rapps);
} elsif ($op eq "include") {
carp "EPICS/Release.pm: Include file '$path' not found\n";
}
+3
View File
@@ -58,7 +58,10 @@ HTMLS = style.css
HTMLS += EPICS/Getopts.html
HTMLS += EPICS/Path.html
HTMLS += EPICS/Readfile.html
HTMLS += fullPathName.html
HTMLS += podToHtml.html
HTMLS += podRemove.html
HTMLS += munch.html
# Build Package Config Files
+16 -14
View File
@@ -14,12 +14,15 @@
#
use strict;
use warnings;
use Cwd qw(cwd);
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
use FindBin qw($Bin);
use lib ("$Bin/../../lib/perl", $Bin);
use Cwd qw(cwd);
use Getopt::Std;
use EPICS::Path;
use EPICS::Release;
@@ -27,8 +30,7 @@ use vars qw($arch $top $iocroot $root);
our ($opt_a, $opt_t, $opt_T);
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
getopts('a:t:T:') or &HELP_MESSAGE;
getopts('a:t:T:') or HELP_MESSAGE();
my $cwd = UnixPath(cwd());
@@ -63,7 +65,7 @@ if ($opt_t) {
}
}
&HELP_MESSAGE unless @ARGV == 1;
HELP_MESSAGE() unless @ARGV == 1;
my $outfile = $ARGV[0];
@@ -80,12 +82,12 @@ expandRelease(\%macros, \@apps);
# This is a perl switch statement:
for ($outfile) {
m/releaseTops/ and do { &releaseTops; last; };
m/dllPath\.bat/ and do { &dllPath; last; };
m/relPaths\.sh/ and do { &relPaths; last; };
m/cdCommands/ and do { &cdCommands; last; };
m/envPaths/ and do { &envPaths; last; };
m/checkRelease/ and do { &checkRelease; last; };
m/releaseTops/ and do { releaseTops(); last; };
m/dllPath\.bat/ and do { dllPath(); last; };
m/relPaths\.sh/ and do { relPaths(); last; };
m/cdCommands/ and do { cdCommands(); last; };
m/envPaths/ and do { envPaths(); last; };
m/checkRelease/ and do { checkRelease(); last; };
die "Output file type \'$outfile\' not supported";
}
@@ -158,7 +160,7 @@ sub cdCommands {
my $startup = $cwd;
$startup =~ s/^$root/$iocroot/o if ($opt_t);
$startup =~ s/([\\"])/\\\1/g; # escape back-slashes and double-quotes
$startup =~ s/([\\"])/\\$1/g; # escape back-slashes and double-quotes
print OUT "startup = \"$startup\"\n";
@@ -171,7 +173,7 @@ sub cdCommands {
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
$iocpath =~ s/([\\"])/\\\1/g; # escape back-slashes and double-quotes
$iocpath =~ s/([\\"])/\\$1/g; # escape back-slashes and double-quotes
my $app_lc = lc($app);
print OUT "$app_lc = \"$iocpath\"\n"
if (-d $path);
@@ -203,7 +205,7 @@ sub envPaths {
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
$iocpath =~ s/([\\"])/\\\1/g; # escape back-slashes and double-quotes
$iocpath =~ s/([\\"])/\\$1/g; # escape back-slashes and double-quotes
print OUT "epicsEnvSet(\"$app\",\"$iocpath\")\n" if (-d $path);
}
close OUT;
+2 -2
View File
@@ -43,7 +43,7 @@ my $errors = 0;
while (@ARGV) {
my $file = shift @ARGV;
eval {
&ParseDBD($dbd, &Readfile($file, $macros, \@opt_I));
ParseDBD($dbd, Readfile($file, $macros, \@opt_I));
};
if ($@) {
warn "dbdExpand.pl: $@";
@@ -72,7 +72,7 @@ if ($opt_o) {
$out = STDOUT;
}
&OutputDBD($out, $dbd);
OutputDBD($out, $dbd);
if ($opt_o) {
close $out or die "Closing $opt_o failed: $!\n";
+1 -1
View File
@@ -32,7 +32,7 @@ my @path = map { split /[:;]/ } @opt_I; # FIXME: Broken on Win32?
my $macros = EPICS::macLib->new(@opt_S);
my $dbd = DBD->new();
&ParseDBD($dbd, &Readfile(shift @ARGV, $macros, \@opt_I));
ParseDBD($dbd, Readfile(shift @ARGV, $macros, \@opt_I));
$Text::Wrap::columns = 75;
+1 -1
View File
@@ -55,7 +55,7 @@ my $infile = shift @ARGV;
$infile =~ m/\.dbd.pod$/ or
die "$tool: Input file '$infile' must have '.dbd.pod' extension\n";
&ParseDBD($dbd, &Readfile($infile, 0, \@opt_I));
ParseDBD($dbd, Readfile($infile, 0, \@opt_I));
if (!$opt_o) {
($opt_o = $infile) =~ s/\.dbd\.pod$/.html/;
+1 -1
View File
@@ -49,7 +49,7 @@ my $guard_name = "INC_$outbase";
$guard_name =~ tr/a-zA-Z0-9_/_/cs;
$guard_name =~ s/(_[hH])?$/_H/;
&ParseDBD($dbd, &Readfile($infile, 0, \@opt_I));
ParseDBD($dbd, Readfile($infile, 0, \@opt_I));
if ($opt_D) {
my %filecount;
+3 -3
View File
@@ -50,7 +50,7 @@ my $guard_name = "INC_$outbase";
$guard_name =~ tr/a-zA-Z0-9_/_/cs;
$guard_name =~ s/(_[hH])?$/_H/;
&ParseDBD($dbd, &Readfile($infile, 0, \@opt_I));
ParseDBD($dbd, Readfile($infile, 0, \@opt_I));
my $rtypes = $dbd->recordtypes;
die "$tool: Input file must contain a single recordtype definition.\n"
@@ -99,9 +99,9 @@ if ($opt_D) { # Output dependencies only, to stdout
"\n} ${rn}FieldIndex;\n\n";
print OUTFILE "#ifdef GEN_SIZE_OFFSET\n\n";
if ($opt_s) {
&newtables;
newtables();
} else {
&oldtables;
oldtables();
}
print OUTFILE "#endif /* GEN_SIZE_OFFSET */\n";
}
+2 -2
View File
@@ -22,10 +22,10 @@ use EPICS::Copy;
# Process command line options
our ($opt_a, $opt_d, @opt_D, $opt_h, $opt_t);
getopts('a:dD@ht:')
or &HELP_MESSAGE;
or HELP_MESSAGE();
# Handle the -h command
&HELP_MESSAGE if $opt_h;
HELP_MESSAGE() if $opt_h;
die "Path to TOP not set, use -t option\n"
unless $opt_t;
+49 -7
View File
@@ -13,17 +13,56 @@
# might have trailing directory names that don't exist yet.
use strict;
use warnings;
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
use FindBin qw($Bin);
use lib ("$Bin/../../lib/perl", $Bin);
use Getopt::Std;
use EPICS::Path;
use Pod::Usage;
=head1 NAME
fullPathName.pl - Convert a pathname to an absolute path
=head1 SYNOPSIS
B<fullPathName.pl> [B<-h>] /path/to/something
=head1 DESCRIPTION
The EPICS build system needs the ability to get the absolute path of a file or
directory that does not exist at the time. The AbsPath() function in the
EPICS::Path module provides the necessary functionality, which this script makes
available to the build system. The string which is returned on the standard
output stream has had any shell special characters escaped with a back-slash
(except on Windows).
=head1 OPTIONS
B<fullPathName.pl> understands the following options:
=over 4
=item B<-h>
Help, display this document as text.
=back
=cut
our ($opt_h);
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
&HELP_MESSAGE if !getopts('h') || $opt_h || @ARGV != 1;
sub HELP_MESSAGE {
pod2usage(-exitval => 2, -verbose => $opt_h);
}
HELP_MESSAGE() if !getopts('h') || $opt_h || @ARGV != 1;
my $path = AbsPath(shift);
@@ -32,8 +71,11 @@ $path =~ s/([!"\$&'\(\)*,:;<=>?\[\\\]^`{|}])/\\$1/g unless $^O eq 'MSWin32';
print "$path\n";
=head1 COPYRIGHT AND LICENSE
sub HELP_MESSAGE {
print STDERR "Usage: fullPathName.pl [-h] pathname\n";
exit 2;
}
Copyright (C) 2009 UChicago Argonne LLC, as Operator of Argonne National
Laboratory.
This software is distributed under the terms of the EPICS Open License.
=cut
+60 -10
View File
@@ -7,19 +7,65 @@
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
# $Revision-Id$
#
# Creates a ctdt.c file of C++ static constructors and destructors,
# as required for all vxWorks binaries containing C++ code.
use strict;
use warnings;
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
our ($opt_o);
use Pod::Usage;
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
&HELP_MESSAGE if !getopts('o:') || @ARGV != 1;
=head1 NAME
munch.pl - Combine C++ static constructors and destructors for libraries
=head1 SYNOPSIS
B<munch.pl> [B<-h>] [B<-o> file_ctdt.c] file.nm
=head1 DESCRIPTION
Creates a ctdt.c file of C++ static constructors and destructors, as required
for all vxWorks binaries containing C++ code. The VxWorks linking loader and
unloader only call one constructor function, so the code generated by this
script is needed to ensure that all the static constructors and destructors in
the library module will be executed at the appropriate time.
The file input to this function is generated by running the B<nm> program on the
library concerned. The processing algorithm was reverse-engineered from the
B<munch.tcl> scripts provided with various versions of VxWorks up to 6.9.
=head1 OPTIONS
B<munch.pl> understands the following options:
=over 4
=item B<-h>
Help, display this document as text.
=item B<-o> file_ctdt.c
Name of the output file to be created.
=back
If no output filename is set with a B<-o> option, the generated C code will be
sent to the standard output stream.
=cut
our ($opt_o, $opt_h);
sub HELP_MESSAGE {
pod2usage(-exitval => 2, -verbose => $opt_h);
}
HELP_MESSAGE() if !getopts('ho:') || $opt_h || @ARGV != 1;
# Is exception handler frame info required?
my $need_eh_frame = 0;
@@ -154,7 +200,11 @@ sub cDecl {
return $decl;
}
sub HELP_MESSAGE {
print STDERR "Usage: munch.pl [-o file_ctdt.c] file.nm\n";
exit 2;
}
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2013 UChicago Argonne LLC, as Operator of Argonne National
Laboratory.
This software is distributed under the terms of the EPICS Open License.
=cut
+52 -8
View File
@@ -6,17 +6,57 @@
# in file LICENSE that is included with this distribution.
#*************************************************************************
# $Id$
# $Revision-Id$
use strict;
use warnings;
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
our ($opt_o);
use Pod::Usage;
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
&HELP_MESSAGE if !getopts('o:') || @ARGV != 1;
=head1 NAME
podRemove.pl - Remove POD directives from files
=head1 SYNOPSIS
B<podRemove.pl> [B<-h>] [B<-o> file] file.pod
=head1 DESCRIPTION
Removes Perl's POD documentation from a text file
=head1 OPTIONS
B<podRemove.pl> understands the following options:
=over 4
=item B<-h>
Help, display this document as text.
=item B<-o> file
Name of the output file to be created.
=back
If no output filename is set, the file created will be named after the input
file, removing any directory components in the path and removing any .pod file
extension.
=cut
our ($opt_o, $opt_h);
sub HELP_MESSAGE {
pod2usage(-exitval => 2, -verbose => $opt_h);
}
HELP_MESSAGE() if !getopts('ho:') || $opt_h || @ARGV != 1;
my $infile = shift @ARGV;
@@ -43,7 +83,11 @@ while (<$inp>) {
close $out;
close $inp;
sub HELP_MESSAGE {
print STDERR "Usage: podRemove.pl [-o file] file.pod\n";
exit 2;
}
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2015 UChicago Argonne LLC, as Operator of Argonne National
Laboratory.
This software is distributed under the terms of the EPICS Open License.
=cut
+19 -13
View File
@@ -6,21 +6,25 @@
# in file LICENSE that is included with this distribution.
#*************************************************************************
# $Id$
# $Revision-Id$
use strict;
use warnings;
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
use Pod::Simple::HTML;
use Pod::Usage;
=head1 NAME
podToHtml.pl - convert EPICS .pod files to .html
podToHtml.pl - Convert EPICS .pod files to .html
=head1 SYNOPSIS
B<podToHtml.pl> [B<-s>] [B<-o> file.html] file.pod
B<podToHtml.pl> [B<-h>] [B<-s>] [B<-o> file.html] file.pod
=head1 DESCRIPTION
@@ -33,10 +37,14 @@ is calculated based on the number of components in the path to the input file.
=head1 OPTIONS
I<podToHtml.pl> understands the following options:
B<podToHtml.pl> understands the following options:
=over 4
=item B<-h>
Help, display this document as text.
=item B<-s>
Indicates that the first component of the input file path is not part of the
@@ -55,11 +63,14 @@ extension with .html.
=cut
our $opt_o;
our ($opt_o, $opt_h);
our $opt_s = 0;
$Getopt::Std::OUTPUT_HELP_VERSION = 1;
&HELP_MESSAGE if !getopts('o:s') || @ARGV != 1;
sub HELP_MESSAGE {
pod2usage(-exitval => 2, -verbose => $opt_h);
}
HELP_MESSAGE() if !getopts('ho:s') || $opt_h || @ARGV != 1;
my $infile = shift @ARGV;
@@ -89,14 +100,9 @@ $podHtml->run;
print $out $html;
close $out;
sub HELP_MESSAGE {
print STDERR "Usage: podToHtml.pl [-s] [-o file.html] file.pod\n";
exit 2;
}
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2010 UChicago Argonne LLC, as Operator of Argonne National
Copyright (C) 2013 UChicago Argonne LLC, as Operator of Argonne National
Laboratory.
This software is distributed under the terms of the EPICS Open License.
+1 -1
View File
@@ -30,7 +30,7 @@ my @path = map { split /[:;]/ } @opt_I; # FIXME: Broken on Win32?
my ($file, $subname, $bldTop) = @ARGV;
my $dbd = DBD->new();
&ParseDBD($dbd, &Readfile($file, "", \@path));
ParseDBD($dbd, Readfile($file, "", \@path));
if ($opt_D) { # Output dependencies only
my %filecount;