#! /usr/bin/perl -w use strict ; use lib '..' ; use lib '../lib' ; use Repocafe ; my $prog = substr($0,rindex($0,'/')+1) ; my $Usage = < ---------------------------------------- USAGE sub Usage { die "$_[0]$Usage" ; } sub Error { die "$prog: $_[0]\n" ; } sub Warn { warn "$prog: $_[0]\n" ; } # usage: &GetOptions(ARG,ARG,..) defines $opt_ID as 1 or user spec'ed value # usage: &GetOptions(\%opt,ARG,ARG,..) defines $opt{ID} as 1 or user value # ARG = 'ID' | 'ID=SPC' | 'ID:SPC' for no-arg, required-arg or optional-arg # ID = perl identifier # SPC = i|f|s for integer, fixedpoint real or string argument use Getopt::Long ; Getopt::Long::config('no_ignore_case') ; our %opt = () ; Usage('') unless GetOptions ( \%opt, qw(v q d f c=s) ) ; Usage("Arg count\n") unless @ARGV == 1 ; Blib::Mods::Doc -> debug ( 1 ) if $opt{d} ; my $PRG = shift ; my $POD = $PRG ; my $Cafe = make_cafe ( %opt, d => 0, -conn => 0 ) ; my $conf = $Cafe -> conf ; Error "can't find source $PRG" unless -f "../$PRG" ; my $version = Version ; my $revision = $Cafe -> revision ; my $date = gmtime $^T ; my $data = $conf -> dir_data ; my $auth = Blib::Mods::Doc -> pod_author ( $version, $revision, $date ) ; my @usage = $Cafe -> usage ( $PRG ) ; my $pwd = `pwd` ; chop $pwd ; my $dir = $conf -> dir_admin . '/doc' ; Error "pwd ($pwd) != $dir" unless $pwd eq $dir ; open POD, ">$POD" or Error "can't write $POD ($!)" ; my $doc = Blib::Mods::Doc -> make ( $PRG, @usage ) ; print POD $doc -> as_pod ( $auth ) ; close POD ; system "perl pod2html --outfile $PRG.html $PRG" ; system "pod2man $PRG $PRG.1" ; system "man ./$PRG.1 > $PRG.txt" ; for my $tmp ( <*.tmp> ) { unlink $tmp ; }