--- pan-0.126/pan/gui/pan.cc	2007-03-28 12:43:51.000000000 -0400
+++ pan-0.126-modified/pan/gui/pan.cc	2007-04-01 18:43:58.000000000 -0400
@@ -30,6 +30,7 @@
 #include <pan/general/worker-pool.h>
 #include <pan/tasks/socket-impl-gio.h>
 #include <pan/tasks/task-groups.h>
+#include <pan/tasks/task-xover.h>
 #include <pan/tasks/nzb.h>
 #include <pan/data-impl/data-impl.h>
 #include <pan/icons/pan-pixbufs.h>
@@ -168,6 +169,7 @@
 "URL Options\n"
 "  news:message-id          Show the specified article.\n"
 "  news:group.name          Show the specified newsgroup.\n"
+"  headers:group.name       Download new headers for the specified newsgroup.\n"
 "  --no-gui                 On news:message-id, dump the article to stdout.\n"
 "\n"
 "NZB Batch Options\n"
@@ -190,6 +192,7 @@
 
   bool gui(true), nzb(false);
   std::string url;
+  std::string group;
   std::string nzb_output_path;
   typedef std::vector<std::string> strings_t;
   strings_t nzb_files;
@@ -197,6 +200,8 @@
   for (int i=1; i<argc; ++i)
   {
     const char * tok (argv[i]);
+    if (!memcmp(tok,"headers:", 8))
+      group = tok+8;
     if (!memcmp(tok,"news:", 5))
       url = tok;
     else if (!strcmp(tok,"--no-gui") || !strcmp(tok,"--nogui"))
@@ -251,20 +256,28 @@
     Queue queue (data, data, &socket_creator, worker_pool, prefs.get_flag("work-online", true));
     g_timeout_add (5000, queue_upkeep_timer_cb, &queue);
 
-    if (nzb)
+    if (nzb || ! group.empty())
     {
-      // if no save path was specified, either prompt for one or
-      // use the user's home directory as a fallback.
-      if (nzb_output_path.empty() && gui)
-        nzb_output_path = GUI::prompt_user_for_save_path (NULL, prefs);
-      if (nzb_output_path.empty()) // user pressed `cancel' when prompted
-        return 0;
-
-      // load the nzb files...
-      std::vector<Task*> tasks;
-      foreach_const (strings_t, nzb_files, it)
-        NZB :: tasks_from_nzb_file (*it, nzb_output_path, cache, data, data, data, tasks);
-      queue.add_tasks (tasks, Queue::BOTTOM);
+
+      if (! group.empty()){
+        Task* header_task;
+        const Quark* group_q = new Quark(group);
+        header_task = new TaskXOver ( data, *group_q, TaskXOver::NEW);
+        queue.add_task (header_task, Queue::BOTTOM);
+        delete group_q;
+      }else{
+        // if no save path was specified, either prompt for one or
+        // use the user's home directory as a fallback.
+        if (nzb_output_path.empty() && gui)
+          nzb_output_path = GUI::prompt_user_for_save_path (NULL, prefs);
+        if (nzb_output_path.empty()) // user pressed `cancel' when prompted
+          return 0;
+        // load the nzb files...
+        std::vector<Task*> tasks;
+        foreach_const (strings_t, nzb_files, it)
+          NZB :: tasks_from_nzb_file (*it, nzb_output_path, cache, data, data, data, tasks);
+        queue.add_tasks (tasks, Queue::BOTTOM);
+      }
 
       // don't open the full-blown Pan, just act as a nzb client,
       // with a gui or without.
