Permalink
Browse files

MooseX::App::Cmd::Command modules should implement execute(), not run()

  • Loading branch information...
1 parent e94a01f commit 3ae2cc69cd6e90ce4c1d5184e52f0d3e88c24b67 @brunoV brunoV committed Sep 16, 2009
View
@@ -65,7 +65,7 @@ See L<App::Cmd/SYNOPSIS>.
documentation => "recheck all results",
);
- sub run {
+ sub execute {
my ( $self, $opt, $args ) = @_;
# you may ignore $opt, it's in the attributes anyway
@@ -90,7 +90,7 @@ MooseX::App::Cmd::Command - Base class for L<MooseX::Getopt> based L<App::Cmd::C
required => 1,
);
- sub run {
+ sub execute {
my ( $self, $opts, $args ) = @_;
print $self->option_field; # also available in $opts->{option_field}
@@ -19,7 +19,7 @@ has 'moo' => (
documentation => "required option field",
);
-sub run {
+sub execute {
my ($self, $opt, $arg) =@_;
die ("cows go " . join(' ', $self->moo));
@@ -16,7 +16,7 @@ has wow => (
documentation => "required option field",
);
-sub run {
+sub execute {
my ($self, $opt, $arg) =@_;
die "my dog name barks " . $self->wow . "\n";
@@ -22,8 +22,8 @@ has widget => (
documentation => "set widget name",
);
-sub run {
- my ($self, $opt, $arg) =@_;
+sub execute {
+ my ($self, $opt, $arg) = @_;
die "the widget name is " . $self->widget . " - @$arg\n";
}
@@ -9,7 +9,7 @@ Test::MyCmd::Command::justusage - it just dies its own usage, no matter what
=cut
-sub run {
+sub execute {
my ($self, $opt, $arg) = @_;
die $self->usage->text;

0 comments on commit 3ae2cc6

Please sign in to comment.