#!/usr1/local/bin/perl5 # # genhelp.pl - Generates help html from current LHEASOFT settings # # Version 1.0 -- July 19, 2001 # Micah Johnson # require "getopts.pl"; require "interface.pl"; # Change this value to location of installation &Getopts('tb:h'); if ( defined $opt_t ) { $topfile = $opt_t; } else { $topfile = "header.txt"; } if ( defined $opt_b ) { $botfile = $opt_b; } else { $botfile = "footer.txt"; } if ( defined $opt_h || scalar(@ARGV) != 1 ) { print <] [-b ] \n"; exit; } $task = $ARGV[0]; $outfile = "$task.html"; print "Writing $outfile...\n"; open INHDR, "$topfile" or die "Failed to open: $topfile\n"; @hdr = ; close INHDR; open INFTR, "$botfile" or die "Failed to open: $botfile\n"; @ftr = ; close INFTR; @fhelp = `fhelp -m cat $task`; open OUTPUT, ">$outfile" or die "Failed to open: $outfile\n"; foreach $line (@hdr) { $line =~ s/\[TASK\]/$task/g; print OUTPUT $line; } foreach $line (@fhelp) { print OUTPUT $line; } foreach $line (@ftr) { print OUTPUT $line; } close OUTPUT;