Index: trunk/ppSub/src/ppSubArguments.c
===================================================================
--- trunk/ppSub/src/ppSubArguments.c	(revision 21183)
+++ trunk/ppSub/src/ppSubArguments.c	(revision 21257)
@@ -1,12 +1,2 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <pslib.h>
-#include <psmodules.h>
-#include <psphot.h>
-
 #include "ppSub.h"
 
@@ -172,4 +162,5 @@
 bool ppSubArgumentsSetup(int argc, char *argv[], pmConfig *config)
 {
+    int argnum;				// Argument Number
     assert(config);
 
@@ -180,10 +171,7 @@
     }
 
-    {
-        int arg;                        // Argument Number
-        if ((arg = psArgumentGet(argc, argv, "-psphot-visual"))) {
-            psArgumentRemove(arg, &argc, argv);
-            psMetadataAddBool(recipe, PS_LIST_TAIL, "PSPHOT.VISUAL", 0, "Visual guide to psphot?", true);
-        }
+    if ((argnum = psArgumentGet(argc, argv, "-psphot-visual"))) {
+	psArgumentRemove(argnum, &argc, argv);
+	psphotSetVisual(true);
     }
 
@@ -381,4 +369,13 @@
     }
 
+    // XXX move this to ppSubArguments
+    int threads = psMetadataLookupS32(NULL, config->arguments, "-threads"); // Number of threads
+    if (threads > 0) {
+        if (!psThreadPoolInit(threads)) {
+            psError(PS_ERR_UNKNOWN, false, "Unable to setup %d threads", threads);
+            return false;
+        }
+    }
+
     return true;
 
