--- trunk/sender.pl 2005/05/14 12:31:27 6 +++ trunk/sender.pl 2005/05/14 13:12:00 8 @@ -9,6 +9,21 @@ sender.pl - command line notify sender utility +=head1 SYNOPSYS + + sender.pl --add=mylist members.txt + sender.pl --list + sender.pl --queue=mylist message.txt + sender.pl --send=mylist + +=head2 All options + +=over 20 + +=item --debug + +Turn on debugging output from C + =cut my ($list_opt,$debug) = (0,0); @@ -40,6 +55,12 @@ my $messages = $loader->find_class('messages'); my $message_list = $loader->find_class('message_list'); +=item --list + +List all available lists and users on them + +=cut + if ($list_opt) { foreach my $list ($lists->retrieve_all) { print $list->name,"\n"; @@ -48,6 +69,17 @@ print "\t",$user->full_name," <", $user->email, ">\n"; } } + +=item --add=list_name + +Add users to list. Users are stored in file (which can be supplied as +argument) or read from C. List should be in following format: + + email@example.com Optional full name of person + dpavlin@rot13.org Dobrica Pavlinusic + +=cut + } elsif ($add_opt) { #my $noticer = $loader->find_class('Noticer') || die "can't find my class!"; my $list = $lists->find_or_create({ @@ -79,6 +111,13 @@ print "list ",$list->name," has $added users\n"; +=item --queue=list_name + +Queue message for later delivery. Message can be read from file (specified as +argument) or read from C. + +=cut + } elsif ($queue_opt) { my $this_list = $lists->search( name => $queue_opt, @@ -105,11 +144,14 @@ print "added message ",$this_message->id, " to list ",$this_list->name,"\n"; } else { - die $0.' - --list show all lists and users - --add=name_of_list < users.txt add users (email@example.com full name) - --queue=name_of_list < message queue message for sending to list - --debug -'; + die "see perldoc $0 for help"; } +=back + +=head1 AUTHOR + +Dobrica Pavlinusic + +=cut +