Skip to content

Commit

Permalink
min required version switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jozef committed May 2, 2009
1 parent be11dae commit 4831021
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions Build.PL
Expand Up @@ -14,6 +14,7 @@ my $builder = Module::Build->new(
'Text::ParseWords' => 0,
'Text::Wrap' => 0,
'List::MoreUtils' => 0,
'CPAN::Version' => 0,
},
build_requires => {
'Test::More' => 0,
Expand Down
9 changes: 7 additions & 2 deletions pod2docbook
Expand Up @@ -3,19 +3,20 @@
use strict;
use warnings;

our $VERSION = '0.01';
our $VERSION = '0.03';

use Getopt::Long;
use Pod::2::DocBook 0.03;
use Pod::Usage;
use List::MoreUtils 'none';
use CPAN::Version;

exit main();

sub main {
my $doctype = 'section';
my $spaces = 2;
my ($title, $double_quotes, $help, $no_header, $base_id, $id_version, $parse_title, $skip);
my ($title, $double_quotes, $help, $no_header, $base_id, $id_version, $parse_title, $skip, $min_version);

GetOptions(
'doctype=s' => \$doctype,
Expand All @@ -28,11 +29,15 @@ sub main {
'id-version=i' => \$id_version,
'parse-title' => \$parse_title,
'skip=s' => \$skip,
'min-version=s' => \$min_version,
) or pod2usage();

pod2usage if $help;
pod2usage if none { $doctype eq $_ } qw(article chapter refentry section);
pod2usage unless $spaces =~ /^\d+$/xms;

die 'version "'.$min_version.'" required, this is just "'.$VERSION.'"'."\n"
if ($min_version and CPAN::Version->vlt($VERSION, $min_version));

# TODO refactor this if so that there are no the same patterns in each of
# the branch
Expand Down

0 comments on commit 4831021

Please sign in to comment.