summaryrefslogtreecommitdiffstats
path: root/lib/App/Hiveminder/Command.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/Hiveminder/Command.pm')
-rw-r--r--lib/App/Hiveminder/Command.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command.pm b/lib/App/Hiveminder/Command.pm
index a85f6d0..fd58ab7 100644
--- a/lib/App/Hiveminder/Command.pm
+++ b/lib/App/Hiveminder/Command.pm
@@ -10,5 +10,20 @@ has hm => (
default => sub { Net::Hiveminder->new(use_config => 1) },
);
+sub run {
+ my ($self, $opt, $args) = @_;
+
+ my $result = $self->command($args);
+
+ if (defined $result) {
+ chomp $result;
+ $result .= "\n" if length $result > 0;
+ print $result;
+ }
+ else {
+ die $self->usage->text;
+ }
+}
+
__PACKAGE__->meta()->make_immutable();
1;