Changeset 7344
- Timestamp:
- Jun 5, 2006, 11:57:27 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotArguments.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotArguments.c
r6851 r7344 1 1 # include "psphot.h" 2 2 # include <glob.h> 3 4 static void usage (void) {5 fprintf (stderr, "USAGE: psphot [-file image(s)] [-list imagelist] (output)\n");6 exit (2);7 }8 3 9 4 pmConfig *psphotArguments (int *argc, char **argv) { … … 12 7 bool status; 13 8 14 if (*argc == 1) usage ();15 16 // basic pslib options 17 psLogSetFormat ("M");9 if (*argc == 1) { 10 psError(PSPHOT_ERR_ARGUMENTS, true, "Too few arguments: %d", *argc); 11 return NULL; 12 } 18 13 19 14 // these other options override the PSPHOT recipe options … … 105 100 pmConfig *config = pmConfigRead(argc, argv); 106 101 102 if (config == NULL) { 103 psError(PSPHOT_ERR_CONFIG, false, "pmConfigRead returns NULL"); 104 psFree(options); 105 return NULL; 106 } 107 107 108 // Storage for other command-line arguments 108 109 config->arguments = psMetadataAlloc (); … … 121 122 // the input file is a required argument; if not found, we will exit 122 123 status = pmConfigFileSetsMD (config->arguments, argc, argv, "INPUT", "-file", "-list"); 123 if (!status) { usage ();} 124 if (!status) { 125 psError(PSPHOT_ERR_ARGUMENTS, false, "pmConfigFileSetsMD failed to parse arguments"); 126 return NULL; 127 } 124 128 125 if (*argc != 2) usage (); 126 129 if (*argc != 2) { 130 psError(PSPHOT_ERR_ARGUMENTS, true, "Expected to see one more argument; saw %d", *argc - 1); 131 return NULL; 132 } 133 127 134 // output position is fixed 128 135 psMetadataAddStr (config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "", argv[1]);
Note:
See TracChangeset
for help on using the changeset viewer.
