#!/usr/bin/env perl use strict; use warnings; use File::Basename qw(basename); require 'BuildTools.recbuildtool'; $ENV{'PERL5LIB'} .= ':lib'; my @scripts = BuildTools::get_bin_scripts(); foreach my $script (@scripts) { generate_pod("bin/$script"); } sub generate_pod { my $script = shift; print "Generating pod documentation for $script\n"; my $script_base = basename($script); my @help = `$script --help-all 2>/dev/null`; open(my $fh, '>', "doc/$script_base.pod") or die "Could not open doc/$script.pod: $!"; print $fh < - Overview of the scripts and the system =item L - A set of simple recs examples =item L - A humorous introduction to RecordStream =item SCRIPT --help - every script has a --help option, like the output above =back FOOTER close $fh; }