Changeset 6876 for trunk/ippTools/src/pzgetexpConfig.c
- Timestamp:
- Apr 17, 2006, 3:03:37 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pzgetexpConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pzgetexpConfig.c
r6837 r6876 21 21 "telescope name", ""); 22 22 23 bool argErr = false; 24 if (! psArgumentParse(args, &argc, argv) || argc != 2) { 25 argErr = true; 26 fprintf (stderr, "error parsing arguments\n"); 27 } 28 29 if (argErr) { 23 bool status = false; 24 if (!psArgumentParse(args, &argc, argv) 25 || argc != 1 26 || strcmp(psMetadataLookupStr(&status, args, "-uri"), "") == 0 27 || strcmp(psMetadataLookupStr(&status, args, "-inst"), "") == 0 28 || strcmp(psMetadataLookupStr(&status, args, "-telescope"), "") == 0 29 ) { 30 fprintf(stderr, "error parsing arguments\n"); 30 31 printf("\nPan-STARRS Phase Z Search Tool\n"); 31 32 printf("Usage: %s -uri -inst -telescope\n\n", argv[0]); 32 33 psArgumentHelp(args); 33 psFree( args);34 psFree(config); 34 35 exit(EXIT_FAILURE); 35 36 } 36 37 37 38 config->args = args; 39 // don't free args here as it's silly to increment the ref count then 40 // "free" it 38 41 39 42 // define Database handle, if used 40 43 config->dbh = pmConfigDB(config->site); 44 if(!config->dbh) { 45 psError(PS_ERR_UNKNOWN, false, "Can't connect to db\n"); 46 psFree(config); 47 exit(EXIT_FAILURE); 48 } 41 49 42 50 return config;
Note:
See TracChangeset
for help on using the changeset viewer.
