summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/WWW/Pocket/Script.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/WWW/Pocket/Script.pm b/lib/WWW/Pocket/Script.pm
index daf237f..068ec3d 100644
--- a/lib/WWW/Pocket/Script.pm
+++ b/lib/WWW/Pocket/Script.pm
@@ -6,6 +6,7 @@ use JSON::PP;
use List::Util 'sum';
use Path::Class;
use URI;
+use Pod::Usage;
use WWW::Pocket;
@@ -55,7 +56,7 @@ sub run {
return $self->$method(@argv);
}
else {
- die "insert usage here";
+ pod2usage(-verbose => 2);
}
}
@@ -63,6 +64,7 @@ sub _method_is_command {
my $self = shift;
my ($name) = @_;
+ return unless $name;
return if $name eq 'run' || $name eq 'meta';
return if $name =~ /^_/;
my $method = $self->meta->find_method_by_name($name);
@@ -72,6 +74,12 @@ sub _method_is_command {
return 1;
}
+# Display help about this script.
+sub help {
+ my $self = shift;
+ pod2usage(-verbose => 1);
+}
+
sub authenticate {
my $self = shift;
$self->pocket;