From ad1a4bc33623b9bca05f827014b64097907aacfb Mon Sep 17 00:00:00 2001 From: gaurav Date: Fri, 27 May 2016 19:16:44 +0530 Subject: Improved synopsis, added 'man' command for manual. --- bin/pocket | 25 +++++++++++++++++++++++++ lib/WWW/Pocket/Script.pm | 10 +++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/bin/pocket b/bin/pocket index b335ae1..f2e33d8 100644 --- a/bin/pocket +++ b/bin/pocket @@ -4,8 +4,32 @@ use warnings; # PODNAME: pocket # ABSTRACT: interact with the Pocket API from the command line +=head1 NAME + +pocket - A command-line tool for Pocket (http://www.getpocket.com/) + =head1 SYNOPSIS +pocket [command] [options ...] + +Commands: + + help Displays this synopsis. + man Displays full documentation. + list Print all unread URLs in your account. + search Print all URLs whose title or URL contains C. + favorites Print all unread, favorite URLs. + add Add URL, optionally with title. + archive Archive URL. + readd Unread/unarchive URL. + favorite Favorite URL. + delete Delete URL. + words Print the number of words in all unread articles. + authenticate Authenticate and store credentials in C<~/.pocket>. + (all commands will do this automatically) + +Example usage: + $ pocket list Enter your consumer key: ... Visit https://getpocket.com/auth/authorize?request_token=...&redirect_uri=https://getpocket.com/ and log in. When you're done, press enter to continue. @@ -13,6 +37,7 @@ use warnings; http://the-toast.net/2015/04/27/looking-back-fragments-from-womens-shelters-1981-1996/view-all/ https://modelviewculture.com/pieces/dreaming-holding-onto-the-hope-of-justice-in-technology-and-america [...] + $ pocket words --archive 2233913 diff --git a/lib/WWW/Pocket/Script.pm b/lib/WWW/Pocket/Script.pm index 068ec3d..005d126 100644 --- a/lib/WWW/Pocket/Script.pm +++ b/lib/WWW/Pocket/Script.pm @@ -74,12 +74,20 @@ sub _method_is_command { return 1; } -# Display help about this script. +# Display quick usage help on this script. sub help { my $self = shift; pod2usage(-verbose => 1); } +# Display comprehensive help about this script. +sub man { + my $self = shift; + pod2usage(-verbose => 2); +} + + + sub authenticate { my $self = shift; $self->pocket; -- cgit v1.2.3