Index: trunk/psModules/src/config/pmConfigRecipes.c
===================================================================
--- trunk/psModules/src/config/pmConfigRecipes.c	(revision 12890)
+++ trunk/psModules/src/config/pmConfigRecipes.c	(revision 12916)
@@ -51,5 +51,5 @@
 
 // this function may be called several times.  it attempts to load the recipe data from one of
-// three locations: config->site, config->camera, and config->argv.  We cannot read the recipes
+// three locations: config->site, config->camera, and argv.  We cannot read the recipes
 // from config->camera until a camera has been read BUT, the argv recipes must override the
 // camera and site recipes.
@@ -124,5 +124,5 @@
 
 // search for options of the form -D KEY VALUE or -D RECIPE:KEY VALUE
-bool pmConfigLoadRecipeOptions (pmConfig *config, char *flag)
+bool pmConfigLoadRecipeOptions (int *argc, char **argv, pmConfig *config, char *flag)
 {
     bool success;
@@ -140,9 +140,9 @@
 
     // -D key value (all added as string)
-    while ((argNum = psArgumentGet (*config->argc, config->argv, flag))) {
-        psArgumentRemove (argNum, config->argc, config->argv);
+    while ((argNum = psArgumentGet (*argc, argv, flag))) {
+        psArgumentRemove (argNum, argc, argv);
 
         // do we have enough arguments?
-        if (argNum + 1 >= *config->argc) {
+        if (argNum + 1 >= *argc) {
             psError(PS_ERR_IO, true, "insufficient parameters for command-line argument -D");
             return false;
@@ -152,5 +152,5 @@
         const char *recipeName = NULL;
         char *key;
-        psArray *words = psStringSplitArray(config->argv[argNum], ":", false);
+        psArray *words = psStringSplitArray(argv[argNum], ":", false);
         switch (words->n) {
         case 1:
@@ -182,17 +182,17 @@
         bool valid = false;
         if (!strcmp (flag, "-D")) {
-            psMetadataAddStr (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", config->argv[argNum+1]);
+            psMetadataAddStr (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", argv[argNum+1]);
             valid = true;
         }
         if (!strcmp (flag, "-Di")) {
-            psMetadataAddS32 (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", atoi(config->argv[argNum+1]));
+            psMetadataAddS32 (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", atoi(argv[argNum+1]));
             valid = true;
         }
         if (!strcmp (flag, "-Df")) {
-            psMetadataAddF32 (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", atof(config->argv[argNum+1]));
+            psMetadataAddF32 (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", atof(argv[argNum+1]));
             valid = true;
         }
         if (!strcmp (flag, "-Db")) {
-            if (!strcasecmp (config->argv[argNum+1], "true")) {
+            if (!strcasecmp (argv[argNum+1], "true")) {
                 psMetadataAddBool (recipe, PS_LIST_TAIL, key, PS_META_REPLACE, "", true);
             } else {
@@ -204,6 +204,6 @@
         assert (valid);  // flag may be: -D, -Df, -Di, -Db
 
-        psArgumentRemove (argNum, config->argc, config->argv);
-        psArgumentRemove (argNum, config->argc, config->argv);
+        psArgumentRemove (argNum, argc, argv);
+        psArgumentRemove (argNum, argc, argv);
     }
     return true;
@@ -214,5 +214,5 @@
 // if VALUE is not an exiting file, it is a symbolic lookup: it is saved on config->recipeSymbols
 // for later interpolation (pmConfigReadRecipes with option CL)
-bool pmConfigLoadRecipeArguments (pmConfig *config)
+bool pmConfigLoadRecipeArguments (int *argc, char **argv, pmConfig *config)
 {
     bool success; 
@@ -228,15 +228,15 @@
     // Go through the command-line arguments
     int argNum; // Argument number for "-recipe"
-    while ((argNum = psArgumentGet(*config->argc, config->argv, "-recipe")) > 0) {
-        psArgumentRemove(argNum, config->argc, config->argv);
-        if (argNum + 1 >= *config->argc) {
+    while ((argNum = psArgumentGet(*argc, argv, "-recipe")) > 0) {
+        psArgumentRemove(argNum, argc, argv);
+        if (argNum + 1 >= *argc) {
             psError(PS_ERR_IO, false, "-recipe command-line switch provided without the required recipe and source\n");
             return false;
         }
 
-        char *recipeName = psStringCopy(config->argv[argNum]); // Name of the recipe
-        psArgumentRemove(argNum, config->argc, config->argv);
-        char *recipeSource = psStringCopy(config->argv[argNum]); // Source of the recipe
-        psArgumentRemove(argNum, config->argc, config->argv);
+        char *recipeName = psStringCopy(argv[argNum]); // Name of the recipe
+        psArgumentRemove(argNum, argc, argv);
+        char *recipeSource = psStringCopy(argv[argNum]); // Source of the recipe
+        psArgumentRemove(argNum, argc, argv);
 
         if (access(recipeSource, R_OK) == 0) {
