our
$VERSION
=
"0.63"
;
sub
new {
my
$class
=
shift
;
my
$eumm_package
=
shift
;
my
$eumm_script
=
shift
;
my
$data
= {};
$data
->{NAME} =
$class
;
{
eval
"require $eumm_package"
;
no
strict
'refs'
;
$data
->{VERSION} = ${
$eumm_package
.
"::VERSION"
};
}
$data
->{PACKAGE} =
$eumm_package
;
$data
->{SCRIPT} =
$eumm_script
;
Getopt::Long::Configure(
"bundling"
);
my
%opts
;
GetOptions(
"build_system|build-system|b"
=> \
$opts
{b},
"compact|c"
=> \
$opts
{c},
"changes_in_pod|changes-in-pod|C"
=> \
$opts
{C},
"help|h"
=> \
$opts
{h},
"no_interactive|no-interactive|I"
=> \
$opts
{I},
"no_pod|no-pod|P"
=> \
$opts
{P},
"no_new_method|no-new-method|q"
=> \
$opts
{q},
"save_as_defaults|save-as-defaults|s"
=> \
$opts
{s},
"verbose|V"
=> \
$opts
{V},
"abstract|a=s"
=> \
$opts
{a},
"alt_build|alt-build|d=s"
=> \
$opts
{d},
"email|e=s"
=> \
$opts
{e},
"name|n=s"
=> \
$opts
{n},
"license|l=s"
=> \
$opts
{l},
"organization|o=s"
=> \
$opts
{o},
"cpanid|p=s"
=> \
$opts
{p},
"permissions|r=s"
=> \
$opts
{r},
"author|u=s"
=> \
$opts
{u},
"version|v=s"
=> \
$opts
{v},
"website|w=s"
=> \
$opts
{w},
) or croak(
"Error in command line arguments\n"
);
if
(
$opts
{h}) {
print
Usage(
$eumm_script
,
$eumm_package
);
return
;
}
my
%standard_options
= (
( (
$opts
{b} ) ? (
BUILD_SYSTEM
=>
'Module::Build'
) : () ),
( (
$opts
{c} ) ? (
COMPACT
=>
$opts
{c} ) : () ),
( (
$opts
{C} ) ? (
CHANGES_IN_POD
=>
$opts
{C} ) : () ),
INTERACTIVE
=> ( (
$opts
{I} ) ? 0 : 1 ),
( (
$opts
{P} ) ? (
NEED_POD
=> 0 ) : () ),
( (
$opts
{
q} ) ? ( NEED_NEW_METHOD => 0 ) : () ),
( ( $opts{s}
) ? (
SAVE_AS_DEFAULTS
=>
$opts
{s} ) : () ),
( (
$opts
{V} ) ? (
VERBOSE
=>
$opts
{V} ) : () ),
( (
$opts
{a} ) ? (
ABSTRACT
=>
$opts
{a} ) : () ),
( (
$opts
{d} ) ? (
ALT_BUILD
=>
$opts
{d} ) : () ),
( (
$opts
{e} ) ? (
EMAIL
=>
$opts
{e} ) : () ),
( (
$opts
{n} ) ? (
NAME
=>
$opts
{n} ) : () ),
( (
$opts
{l} ) ? (
LICENSE
=>
$opts
{l} ) : () ),
( (
$opts
{o} ) ? (
ORGANIZATION
=>
$opts
{o} ) : () ),
( (
$opts
{p} ) ? (
CPANID
=>
$opts
{p} ) : () ),
( (
$opts
{r} ) ? (
PERMISSIONS
=>
$opts
{r} ) : () ),
( (
$opts
{u} ) ? (
AUTHOR
=>
$opts
{u} ) : () ),
( (
$opts
{v} ) ? (
VERSION
=>
$opts
{v} ) : () ),
( (
$opts
{w} ) ? (
WEBSITE
=>
$opts
{w} ) : () ),
USAGE_MESSAGE
=> Usage(
$data
->{SCRIPT},
$data
->{PACKAGE},
$data
->{VERSION},
),
);
$data
->{STANDARD_OPTIONS} = {
%standard_options
};
return
bless
$data
,
$class
;
}
sub
get_standard_options {
my
$self
=
shift
;
return
%{
$self
->{STANDARD_OPTIONS} };
}
sub
Usage {
my
(
$script
,
$eumm_package
) =
@_
;
my
$message
=
<<ENDOFUSAGE;
modulemaker [-CIPVbch] [-n module_name] [-a abstract]
[-u author_name] [-p author_CPAN_ID] [-o organization]
[-w author_website] [-e author_e-mail]
[-l license_name] [-v version] [-s save_selections_as_defaults ]
Currently Supported Features
-a|--abstract Specify (in quotes) an abstract for this extension
-b|--build_system Use Module::Build as build system for this extension
-c|--compact Flag for compact base directory name
-C|--changes_in_pod Omit creating the Changes file, add HISTORY heading to stub POD
-d|--alt_build Call methods which override default methods from this module
-e|--email Specify author's e-mail address
-h|--help Display this help message and exit
-I|--no_interactive Disable INTERACTIVE mode, the command line arguments better be complete
-l|--license Specify a license for this extension
-n|--name Specify a name to use for the extension (required)
-o|--organization Specify (in quotes) author's organization
-p|--cpanid Specify author's CPAN ID
-P|--no_pod Flag to omit the stub POD section from module
-q|--no_new_method Flag to omit a constructor from module
-r|--permissions Specify permissions
-s|--save_as_defaults Flag to save selections as new personal default values
-u|--author Specify (in quotes) author's name
-v|--version Specify an initial version number for this extension
-V|--verbose Flag for verbose messages during module creation
-w|--website Specify author's web site
$script
$eumm_package version: $VERSION
ENDOFUSAGE
return
(
$message
);
}
1;