comparison src/noffle.c @ 293:b0e754727abf noffle

[svn] * docs/noffle.1,src/outgoing.c,src/noffle.c: Added -O/--outgoing option to list articles waiting to be posted upstream. Modified Out_next() to return message ID if possible, regardless of whether article text was requested as well.
author bears
date Thu, 30 Jan 2003 15:49:23 +0000
parents c02c4eb95f95
children 52ce87d25641
comparison
equal deleted inserted replaced
292:b1d5c55b76f6 293:b0e754727abf
8 not as server. If noffle runs as server, locking is performed while 8 not as server. If noffle runs as server, locking is performed while
9 executing NNTP commands, but temporarily released if no new command is 9 executing NNTP commands, but temporarily released if no new command is
10 received for some seconds (to allow multiple clients connect at the same 10 received for some seconds (to allow multiple clients connect at the same
11 time). 11 time).
12 12
13 $Id: noffle.c 420 2003-01-10 23:25:45Z bears $ 13 $Id: noffle.c 425 2003-01-30 15:49:23Z bears $
14 */ 14 */
15 15
16 #if HAVE_CONFIG_H 16 #if HAVE_CONFIG_H
17 #include <config.h> 17 #include <config.h>
18 #endif 18 #endif
192 } 192 }
193 193
194 Lock_releaseFetchLock(); 194 Lock_releaseFetchLock();
195 } 195 }
196 196
197 /* List articles queued for posting to one particular server */
198 static void
199 listOutgoing1( const char* serv )
200 {
201 Str msgid;
202
203 if ( ! Out_first( serv, msgid, NULL ) )
204 return;
205 do
206 printf( "%s %s\n", msgid, serv );
207 while ( Out_next( msgid, NULL ) );
208 }
209
210 /* List articles queued for posting to a particular server. */
211 static void
212 doOutgoing( const char *arg )
213 {
214 Str serv;
215
216 Cfg_beginServEnum();
217 while ( Cfg_nextServ( serv ) )
218 if ( ! arg || Wld_match( serv, arg ) )
219 listOutgoing1( serv );
220 }
221
197 static Bool 222 static Bool
198 doPost( FILE *f, unsigned flags ) 223 doPost( FILE *f, unsigned flags )
199 { 224 {
200 Str line; 225 Str line;
201 DynStr *s; 226 DynStr *s;
541 " -l | --list List groups on fetch list\n" 566 " -l | --list List groups on fetch list\n"
542 " -m | --modify desc <grp> <desc> Modify a group description\n" 567 " -m | --modify desc <grp> <desc> Modify a group description\n"
543 " -m | --modify post <grp> (y|n) Modify posting status of a local group\n" 568 " -m | --modify post <grp> (y|n) Modify posting status of a local group\n"
544 " -n | --online Switch to online mode\n" 569 " -n | --online Switch to online mode\n"
545 " -o | --offline Switch to offline mode\n" 570 " -o | --offline Switch to offline mode\n"
571 " -O | --outgoing [server] List articles queued for posting\n"
546 " -p | --post Post article on stdin\n" 572 " -p | --post Post article on stdin\n"
547 " -q | --query groups [server] Get group list from server\n" 573 " -q | --query groups [server] Get group list from server\n"
548 " -q | --query desc [server] Get group descriptions from server\n" 574 " -q | --query desc [server] Get group descriptions from server\n"
549 " -r | --server Run as server on stdin/stdout\n" 575 " -r | --server Run as server on stdin/stdout\n"
550 " -R | --requested List articles marked for download\n" 576 " -R | --requested List articles marked for download\n"
806 { "--help", "-h" }, 832 { "--help", "-h" },
807 { "--list", "-l" }, 833 { "--list", "-l" },
808 { "--modify", "-m" }, 834 { "--modify", "-m" },
809 { "--offline", "-o" }, 835 { "--offline", "-o" },
810 { "--online", "-n" }, 836 { "--online", "-n" },
837 { "--outgoing", "-O" },
811 { "--post", "-p" }, 838 { "--post", "-p" },
812 { "--query", "-q" }, 839 { "--query", "-q" },
813 { "--rebuild", "-B" }, 840 { "--rebuild", "-B" },
814 { "--server", "-r" }, 841 { "--server", "-r" },
815 { "--requested", "-R" }, 842 { "--requested", "-R" },
971 if ( Online_true() ) 998 if ( Online_true() )
972 fprintf( stderr, "NOFFLE is already online\n" ); 999 fprintf( stderr, "NOFFLE is already online\n" );
973 else 1000 else
974 Online_set( TRUE ); 1001 Online_set( TRUE );
975 break; 1002 break;
1003 case 'O':
1004 doOutgoing( *argv );
1005 break;
976 case 'o': 1006 case 'o':
977 if ( ! Online_true() ) 1007 if ( ! Online_true() )
978 fprintf( stderr, "NOFFLE is already offline\n" ); 1008 fprintf( stderr, "NOFFLE is already offline\n" );
979 else 1009 else
980 Online_set( FALSE ); 1010 Online_set( FALSE );