Index: trunk/psphot/src/psphotArguments.c
===================================================================
--- trunk/psphot/src/psphotArguments.c	(revision 6715)
+++ trunk/psphot/src/psphotArguments.c	(revision 6851)
@@ -10,4 +10,5 @@
 
     int N;
+    bool status;
 
     if (*argc == 1) usage ();
@@ -118,57 +119,7 @@
     }
 
-    // we load all input files onto a psArray, to be parsed later
-    psArray *input = psArrayAlloc (16);
-    input->n = 0;
-
-    // load the list of filenames the supplied file (may be a glob: "file*.fits")
-    if ((N = psArgumentGet (*argc, argv, "-file"))) {
-	glob_t globList;
-	psArgumentRemove (N, argc, argv);
-	globList.gl_offs = 0;
-	glob (argv[N], 0, NULL, &globList);
-	for (int i = 0; i < globList.gl_pathc; i++) {
-	    char *filename = psStringCopy (globList.gl_pathv[i]);
-	    psArrayAdd (input, 16, filename);
-	    psFree (filename);
-	}
-	psArgumentRemove (N, argc, argv);
-    }
-
-    // load the list from the supplied text file
-    if ((N = psArgumentGet (*argc, argv, "-list"))) {
-	int nItems;
-	char line[1024]; // XXX limits the list lines to 1024 chars
-	char word[1024];
-	char *filename;
-
-	psArgumentRemove (N, argc, argv);
-	FILE *f = fopen (argv[N], "r");
-	if (f == NULL) {
-	    psAbort ("psphot", "unable to open specified list file");
-	}
-	while (fgets (line, 1024, f) != NULL) {
-	    nItems = sscanf (line, "%s", word);
-	    switch (nItems) {
-	      case 0:
-		break;
-	      case 1:
-		filename = psStringCopy (word);
-		psArrayAdd (input, 16, filename);
-		psFree (filename);
-		break;
-	      default:
-		// rigid format, no comments allowed?
-		psAbort ("psphot", "error parsing input list file");
-		break;
-	    }
-	}
-	psArgumentRemove (N, argc, argv);
-    }		
-    if (input->n < 1) usage ();
-
-    // input list gets places as an array on the config->arguements list
-    psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "INPUT",  PS_DATA_ARRAY, "", input);
-    psFree (input);
+    // the input file is a required argument; if not found, we will exit
+    status = pmConfigFileSetsMD (config->arguments, argc, argv, "INPUT", "-file", "-list");
+    if (!status) { usage ();}
 
     if (*argc != 2) usage ();
