diff 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
line wrap: on
line diff
--- a/src/noffle.c	Tue Jan 28 11:38:58 2003 +0000
+++ b/src/noffle.c	Thu Jan 30 15:49:23 2003 +0000
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 420 2003-01-10 23:25:45Z bears $
+  $Id: noffle.c 425 2003-01-30 15:49:23Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -194,6 +194,31 @@
     Lock_releaseFetchLock();
 }
 
+/* List articles queued for posting to one particular server */
+static void
+listOutgoing1( const char* serv )
+{
+  Str msgid;
+
+  if ( ! Out_first( serv, msgid, NULL ) )
+      return;
+  do
+      printf( "%s %s\n", msgid, serv );
+  while ( Out_next( msgid, NULL ) );
+}
+
+/* List articles queued for posting to a particular server. */
+static void
+doOutgoing( const char *arg )
+{
+    Str serv;
+
+    Cfg_beginServEnum();   
+    while ( Cfg_nextServ( serv ) )
+	if ( ! arg || Wld_match( serv, arg ) )
+	    listOutgoing1( serv );
+}
+
 static Bool
 doPost( FILE *f, unsigned flags )
 {
@@ -543,6 +568,7 @@
       " -m | --modify post <grp> (y|n)   Modify posting status of a local group\n"
       " -n | --online                    Switch to online mode\n"
       " -o | --offline                   Switch to offline mode\n"
+      " -O | --outgoing [server]         List articles queued for posting\n"
       " -p | --post                      Post article on stdin\n"
       " -q | --query groups [server]     Get group list from server\n"
       " -q | --query desc [server]       Get group descriptions from server\n"
@@ -808,6 +834,7 @@
 	{ "--modify", 		"-m" },
 	{ "--offline", 		"-o" },
 	{ "--online", 		"-n" },
+	{ "--outgoing", 	"-O" },
 	{ "--post", 		"-p" },
 	{ "--query", 		"-q" },
 	{ "--rebuild", 		"-B" },
@@ -973,6 +1000,9 @@
         else
             Online_set( TRUE );
         break;
+    case 'O':
+        doOutgoing( *argv );
+        break;
     case 'o':
         if ( ! Online_true() )
             fprintf( stderr, "NOFFLE is already offline\n" );