Index: trunk/psModules/src/config/pmConfigRecipes.c
===================================================================
--- trunk/psModules/src/config/pmConfigRecipes.c	(revision 10428)
+++ trunk/psModules/src/config/pmConfigRecipes.c	(revision 10436)
@@ -19,4 +19,31 @@
 static bool loadRecipeSymbols(pmConfig *config);
 static bool loadRecipeOptions(pmConfig *config);
+
+// use this function to select the options structure for the specified recipe
+// add additional command-line options to this metadata (before parsing the camera)
+psMetadata *pmConfigRecipeOptions (pmConfig *config, char *recipeName)
+{
+
+    // if the recipe is already defined in config->arguments, supplement
+    // save the recipe options onto config->arguments:RECIPES
+    psMetadata *options = psMetadataLookupMetadata(NULL, config->arguments, "OPTIONS");
+    if (!options) {
+        options = psMetadataAlloc ();
+        psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "OPTIONS",  PS_DATA_METADATA, "", options);
+    } else {
+        psMemIncrRefCounter (options); // so we can free options below if not allocated here
+    }
+
+    // look for the recipe defined in recipes
+    psMetadata *recipe = psMetadataLookupMetadata(NULL, options, recipeName);
+    if (!recipe) {
+        recipe = psMetadataAlloc ();
+        psMetadataAddPtr (options, PS_LIST_TAIL, recipeName,  PS_DATA_METADATA, "", recipe);
+    } else {
+        psMemIncrRefCounter (recipe); // so we can free options below if not allocated here
+    }
+    psFree (options);
+    return (recipe);
+}
 
 // this function may be called several times.  it attempts to load the recipe data from one of
Index: trunk/psModules/src/config/pmConfigRecipes.h
===================================================================
--- trunk/psModules/src/config/pmConfigRecipes.h	(revision 10428)
+++ trunk/psModules/src/config/pmConfigRecipes.h	(revision 10436)
@@ -9,6 +9,6 @@
 /// @author Eugene Magnier, IfA
 ///
-/// @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2006-12-04 20:41:51 $
+/// @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2006-12-04 21:38:08 $
 ///
 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii
@@ -29,4 +29,5 @@
 bool pmConfigLoadRecipeArguments (pmConfig *config);
 bool pmConfigLoadRecipeOptions (pmConfig *config, char *flag);
+psMetadata *pmConfigRecipeOptions (pmConfig *config, char *recipe);
 
 #endif
