|
From: Jason B. <br...@us...> - 2005-01-06 20:47:36
|
Update of /cvsroot/openxcat/openxcat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6873 Added Files: gendocs Log Message: Simple utility to generate man pages for oXc --- NEW FILE: gendocs --- #!/usr/bin/perl # # Jason Brechin <br...@nc...> # Copyright 2005 The Board of Trustees of the University of Illinois. opendir(BIN, 'bin'); push( @bin, grep { ! /^\./ && -f "bin/$_" } readdir(BIN) ); closedir BIN; foreach my $f (@bin) { $f = "bin/$f"; } opendir(SBIN, 'sbin'); push( @sbin, grep { ! /^\./ && -f "sbin/$_" } readdir(SBIN) ); closedir SBIN; foreach my $f (@sbin) { $f = "sbin/$f"; } @files = (@bin, @sbin); push( @files, qw( lib/openXcat/Base.pm lib/openXcat/Config.pm lib/openXcat/Netboot.pm) ); if ( ! -d 'man/man1' || ! -d 'man/man3' || ! -d 'man/man5' ) { system("mkdir -p man/man1 man/man3 man/man5"); } foreach my $file (@files) { if ( $file =~ /~$/ ) { next; } $file =~ /(?:\S*\/)?(\S+)/; my $page = $1; if ( $file =~ /^.?bin/ ) { #Sec. 1 system("pod2man -v --section=1 $file > man/man1/$page.1"); } elsif ( $file =~ /^lib/ ) { #Sec. 3 system("pod2man -v --section=3 $file > man/man3/$page.3"); } else { #Sec. 5 system("pod2man -v --section=5 $file > man/man5/$page.5"); } } |