App-Cmd-Starter

 view release on metacpan or  search on metacpan

lib/Module/Starter/Plugin/App/Cmd.pm  view on Meta::CPAN

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
        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

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
package $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

212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
 
# 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 )