/[notice-sender]/trunk/sender.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/sender.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by dpavlin, Mon May 16 22:32:58 2005 UTC revision 38 by dpavlin, Tue May 17 21:37:06 2005 UTC
# Line 40  my $result = GetOptions( Line 40  my $result = GetOptions(
40          "inbox=s" => \$opt->{'inbox'},          "inbox=s" => \$opt->{'inbox'},
41          "debug" => \$debug,          "debug" => \$debug,
42          "verbose" => \$verbose,          "verbose" => \$verbose,
         "email=s" => \$opt->{'email'},  
43  );  );
44    
45  my $nos = new Nos(  my $nos = new Nos(
# Line 83  if ($list_name = $opt->{'new'}) { Line 82  if ($list_name = $opt->{'new'}) {
82    
83          die "need e-mail address for list (as argument or on STDIN)\n" unless ($email);          die "need e-mail address for list (as argument or on STDIN)\n" unless ($email);
84    
85          my $l = $nos->_get_list($list_name) || $nos->_add_list(          my $id = $nos->new_list(
86                  list => $list_name,                  list => $list_name,
87                  email => $email,                  email => $email,
88          ) || die "can't add list $list_name\n";          ) || die "can't add list $list_name\n";
89    
90          print "added list $list_name with ID ",$l->id,"\n";          print "added list $list_name with ID $id\n";
91    
92    
93  =item --list[=list_name]  =item --list[=list_name]
# Line 127  argument) or read from C<STDIN>. List sh Line 126  argument) or read from C<STDIN>. List sh
126   email@example.com      Optional full name of person   email@example.com      Optional full name of person
127   dpavlin@rot13.org      Dobrica Pavlinusic   dpavlin@rot13.org      Dobrica Pavlinusic
128    
 You may use C<--email> parametar at any time to set From: e-mail address for list.  
 B<This seems somewhat cludgy, and it will probably change in future>.  
   
129  =cut  =cut
130    
131  } elsif ($list_name = $opt->{'add'}) {  } elsif ($list_name = $opt->{'add'}) {
# Line 190  add C<--verbose> flag, it will display a Line 186  add C<--verbose> flag, it will display a
186                          my $msg = $m->message_id->message;                          my $msg = $m->message_id->message;
187                          $msg =~ s/\s+/ /gs;                          $msg =~ s/\s+/ /gs;
188    
189                          $l .= sprintf(" %-10s %15s : ", $m->list_id->name, $date);                          $l .= sprintf(" %-15s %15s : ", $m->list_id->name, $date);
190                          $l .= substr($msg, 0, 79 - length($l));                          $l .= substr($msg, 0, 79 - length($l));
191    
192                          print "$l\n";                          print "$l\n";
# Line 217  Feed incomming message back into notice Line 213  Feed incomming message back into notice
213    
214  =cut  =cut
215    
216  } elsif ($opt->{'inbox'}) {  } elsif ($list_name = $opt->{'inbox'}) {
217    
218            my $message;
219            while(<>) {
220                    $message .= $_;
221            }
222    
223            $nos->inbox_message(
224                    list => $list_name,
225                    message => $message,
226            ) || die "can't receive message for list $list_name";
227    
         warn "inbox option is not implemented";  
228    
229  } else  {  } else  {
230          die "see perldoc $0 for help\n";          die "see perldoc $0 for help\n";
# Line 241  Turn on debugging output from C<Class::D Line 246  Turn on debugging output from C<Class::D
246    
247  Dump more info on screen.  Dump more info on screen.
248    
 =item --email  
   
 Used to specify e-mail address where needed.  
   
249  =back  =back
250    
251    

Legend:
Removed from v.32  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.26