#!/usr/bin/perl # # podify - preprocess configuration-style files to pod # # Copyright (C) 1998, Ford & Mason Ltd. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of either: # # a) the GNU General Public License as published by the Free # Software Foundation; either version 1, or (at your option) any # later version, or # # b) the "Artistic License" which comes with the Perl distribution. # # $Id: podify,v 1.2 1998/11/24 21:16:19 andrew Exp $ # use strict; use Getopt::Long; my $comment_re = "#"; my $leading_spaces = 1; my $verbatim_indent = 4; my $help; GetOptions("comment-re=s" => \$comment_re, "leading-spaces=i" => \$leading_spaces, "verbatim-indent=i" => \$verbatim_indent, "help" => \$help) or usage(); usage() if $help; $leading_spaces = " " x $leading_spaces; $verbatim_indent = " " x $verbatim_indent; while (<>) { chop; $_ = $verbatim_indent . $_ unless s/^(?:\s*$|$comment_re(?:\s*$|$leading_spaces))//; print "$_\n"; } exit; sub usage { die <