App-Cmd-Starter
view release on metacpan or search on metacpan
lib/Module/Starter/Plugin/App/Cmd.pm view on Meta::CPAN
656667686970717273747576777879808182838485
when
(
$main_module
) {
$self
->main_module_guts(
$module
,
$rtname
);
}
when
(
"$main_module"
.
"::Command"
) {
$self
->command_pm_guts(
$module
);
}
when
(/(
$main_module
\b::Command)::(\w+)/) {
$self
->command_module_guts(
$module
, $1,
lc
$2);
}
default
{
$self
->SUPER::module_guts(
$module
,
$rtname
);
}
}
}
#-------------------------------------------------------------------------------
sub
main_module_guts {
my
$self
=
shift
;
my
$module
=
shift
;
lib/Module/Starter/Plugin/App/Cmd.pm view on Meta::CPAN
159160161162163164165166167168169170171172173174175176177178179package
$module
;
use
App::Cmd::Setup -command;
sub
opt_spec {
my
( \
$class
, \
$app
) = \
@_
;
# Example options
#
# return (
# [ 'name=s' => "Name", {default => \$SUPER::config->{name} || undef} ],
# );
return
();
}
sub
validate_args {
my
( \
$self
, \
$opt
, \
$args
) = \
@_
;
# Example validation
#
# \$self->usage_message('Your error here') unless (\$some_condition);
lib/Module/Starter/Plugin/App/Cmd.pm view on Meta::CPAN
212213214215216217218219220221222223224225226227228229230231232233234# Command specific options
sub
opt_spec {
my
(\
$class
, \
$app
) = \
@_
;
return
(
# Example options
#
# [ "familiar" => "Use an informal greeting", {default => \$SUPER::config->{familiar} || undef} ],
\
$class
->SUPER::opt_spec,
# Include global options
);
}
# The command itself
sub
execute {
my
(\
$self
, \
$opt
, \
$args
) = \
@_
;
# require 'My::Dependency';
( run in 1.972 second using v1.01-cache-2.11-cpan-55f5a4728d2 )