Skip to content

Commit

Permalink
Add 'help' screen and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
robertkrimen committed Apr 6, 2009
1 parent 164ddfd commit 7318f26
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,8 +1,8 @@
TODO:
- Image fetching/uploading
- Add 'help' screen and documentation

Sunday April 05 14:56:51 PDT 2009:
- Add 'help' screen and documentation
- Generate better config stub
- Config checker
- Improve history display
Expand Down
33 changes: 29 additions & 4 deletions README
Expand Up @@ -5,12 +5,37 @@ VERSION
Version 0.01_1

SYNOPSIS
# From the command-line
pm-announce test
# Using the commandline...
pm-announce template > event.txt

# Edit event.txt with your editor of choice...
pm-announce announce < event.txt

DESCRIPTION
App::PM::Announce is a tool for creating and advertising PM meetings.
More soon
App::PM::Announce is a tool for creating and advertising PM meetings (on
Meetup, LinkedIn, and blog software)

OPTIONS

verbose|v Debugging mode. Be verbose when reporting
help|h|? This help screen
dry-run|n Don't actually login and announce, just show what would be done

COMMANDS

config Check the config file (@{[ app->config_file ]})

history Show announcement history

history <query> Show announcement history for event <query>, where <query> should be enough of the uuid to be unambiguous

template Print out a template to be used for input to the 'announce' command

announce Read STDIN for the event information and make a post for each feed

test Post a bogus event to a test meetup account, test linkedin account, and test greymatter account

help This help screen

AUTHOR
Robert Krimen, "<rkrimen at cpan.org>"
Expand Down
31 changes: 28 additions & 3 deletions lib/App/PM/Announce.pm
Expand Up @@ -374,12 +374,37 @@ _END_

=head1 SYNOPSIS
# From the command-line
pm-announce test
# Using the commandline...
pm-announce template > event.txt
# Edit event.txt with your editor of choice...
pm-announce announce < event.txt
=head1 DESCRIPTION
App::PM::Announce is a tool for creating and advertising PM meetings. More soon
App::PM::Announce is a tool for creating and advertising PM meetings (on Meetup, LinkedIn, and blog software)
OPTIONS
verbose|v Debugging mode. Be verbose when reporting
help|h|? This help screen
dry-run|n Don't actually login and announce, just show what would be done
COMMANDS
config Check the config file (@{[ app->config_file ]})
history Show announcement history
history <query> Show announcement history for event <query>, where <query> should be enough of the uuid to be unambiguous
template Print out a template to be used for input to the 'announce' command
announce Read STDIN for the event information and make a post for each feed
test Post a bogus event to a test meetup account, test linkedin account, and test greymatter account
help This help screen
=cut

Expand Down
77 changes: 62 additions & 15 deletions lib/App/PM/Announce/App.pm
Expand Up @@ -16,30 +16,62 @@ sub app {
return $app ||= App::PM::Announce->new(@app);
}

sub help {
print <<_END_
Usage:
$0 [OPTIONS] <COMMAND>
OPTIONS
verbose|v Debugging mode. Be verbose when reporting
help|h|? This help screen
dry-run|n Don't actually login and announce, just show what would be done
COMMANDS
config Check the config file (@{[ app->config_file ]})
history Show announcement history
history <query> Show announcement history for event <query>, where <query> should be enough of the uuid to be unambiguous
template Print out a template to be used for input to the 'announce' command
announce Read STDIN for the event information and make a post for each feed
test Post a bogus event to a test meetup account, test linkedin account, and test greymatter account
help This help screen
SYNOPSIS
# Using the commandline...
pm-announce template > event.txt
# Edit event.txt with your editor of choice...
pm-announce announce < event.txt
_END_
}

sub run {
Getopt::Chain->process(
options => [qw/ verbose|v dry-run|n /],
options => [qw/ verbose|v dry-run|n help|h|? /],
run => sub {
my ($context, @arguments) = @_;
push @app, qw/debug 1 verbose 1/ if $context->option( 'verbose' );
push @app, qw/dry_run 1/ if $context->option( 'dry-run' );
return if @arguments;
return if @arguments && ! $context->option( 'help' );
app;
print <<_END_;
The only thing you can do right now:
$0 test
Which will submit an announcement to:
robert...krimen\@gmail.com / test8378 \@ http://www.meetup.com/The-San-Francisco-Beta-Tester-Meetup-Group/calendar/?action=new
robertkrimen+alice8378\@gmail.com / test8378 \@ http://www.linkedin.com/groupAnswers?start=&gid=1873425
alice8378 / test8378 \@ http://72.14.179.195/cgi-bin/greymatter/gm.cgi
_END_
help;
exit;
},
commands => {
help => sub {
help;
},
config => sub {
my ($context, @arguments) = @_;
my $config = app->config;
Expand Down Expand Up @@ -149,3 +181,18 @@ _END_
}

1;

__END__
print <<_END_;
The only thing you can do right now:
$0 test
Which will submit an announcement to:
robert...krimen\@gmail.com / test8378 \@ http://www.meetup.com/The-San-Francisco-Beta-Tester-Meetup-Group/calendar/?action=new
robertkrimen+alice8378\@gmail.com / test8378 \@ http://www.linkedin.com/groupAnswers?start=&gid=1873425
alice8378 / test8378 \@ http://72.14.179.195/cgi-bin/greymatter/gm.cgi
_END_

0 comments on commit 7318f26

Please sign in to comment.