add the start of the bin and various bits to the makefile.pl

This commit is contained in:
Zane C. B-H 2019-05-01 02:34:30 -05:00
parent 21373abcf0
commit a4b605da30
2 changed files with 69 additions and 22 deletions

View File

@ -10,6 +10,7 @@ my %WriteMakefileArgs = (
ABSTRACT_FROM => 'lib/VM/CBSD/Poller.pm',
LICENSE => 'artistic_2',
MIN_PERL_VERSION => '5.006',
INST_SCRIPT => 'bin',
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => '0',
},
@ -17,12 +18,12 @@ my %WriteMakefileArgs = (
'Test::More' => '0',
},
PREREQ_PM => {
#'ABC' => '1.6',
#'Foo::Bar::Module' => '5.0401',
'JSON'=>'2.97.001',
'Error::Helper'=>'1.0.0',
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'VM-CBSD-Poller-*' },
);
);
# Compatibility with old versions of ExtUtils::MakeMaker
unless (eval { ExtUtils::MakeMaker->VERSION('6.64'); 1 }) {
@ -36,10 +37,10 @@ unless (eval { ExtUtils::MakeMaker->VERSION('6.55_03'); 1 }) {
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION('6.52'); 1 };
unless eval { ExtUtils::MakeMaker->VERSION('6.52'); 1 };
delete $WriteMakefileArgs{MIN_PERL_VERSION}
unless eval { ExtUtils::MakeMaker->VERSION('6.48'); 1 };
unless eval { ExtUtils::MakeMaker->VERSION('6.48'); 1 };
delete $WriteMakefileArgs{LICENSE}
unless eval { ExtUtils::MakeMaker->VERSION('6.31'); 1 };
unless eval { ExtUtils::MakeMaker->VERSION('6.31'); 1 };
WriteMakefile(%WriteMakefileArgs);

View File

@ -0,0 +1,46 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use Device::RAID::Poller;
use JSON;
sub version{
print "check_raid v. 0.0.0\n";
}
sub help{
&version;
print '
-p Print the JSON in a pretty format.
';
}
# command line option holders
my $help=0;
my $version=0;
my $pretty=0;
# get the commandline options
Getopt::Long::Configure ('no_ignore_case');
Getopt::Long::Configure ('bundling');
GetOptions(
'version' => \$version,
'v' => \$version,
'help' => \$help,
'h' => \$help,
'p' => \$pretty,
);
# print version or help if requested
if ( $help ){
&help;
exit 42;
}
if ( $version ){
&version;
exit 42;
}