comparison sidinfo.c @ 23:832c26cb1637

Improve option handling.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Sep 2014 03:36:58 +0300
parents 6ba8403930ab
children 16d6b5029543
comparison
equal deleted inserted replaced
22:c89a20bce211 23:832c26cb1637
475 return FALSE; 475 return FALSE;
476 } 476 }
477 477
478 // Read PSID data 478 // Read PSID data
479 if (siReadPSIDFile(inFile, &psid) != 0) 479 if (siReadPSIDFile(inFile, &psid) != 0)
480 {
481 THERR("Error reading %s\n", filename);
480 goto error; 482 goto error;
483 }
481 484
482 // Output 485 // Output
483 siPrintPSIDInformation(stdout, optParsable, optHexadecimal, optFields, filename, &psid); 486 siPrintPSIDInformation(stdout, optParsable, optHexadecimal, optFields, filename, &psid);
484 487
485 // Shutdown 488 // Shutdown
497 th_init("SIDInfo", "PSID/RSID information displayer", "0.3", NULL, NULL); 500 th_init("SIDInfo", "PSID/RSID information displayer", "0.3", NULL, NULL);
498 th_verbosityLevel = 0; 501 th_verbosityLevel = 0;
499 502
500 // Parse command line arguments 503 // Parse command line arguments
501 if (!th_args_process(argc, argv, optList, optListN, 504 if (!th_args_process(argc, argv, optList, optListN,
502 argHandleOpt, argHandleFile, FALSE)) 505 argHandleOpt, argHandleFile, OPTH_ONLY_OPTS))
503 return -1; 506 return -1;
507
508 // Process files
509 if (!th_args_process(argc, argv, optList, optListN,
510 argHandleOpt, argHandleFile, OPTH_ONLY_OTHER))
511 return -2;
504 512
505 if (optNFiles == 0) 513 if (optNFiles == 0)
506 { 514 {
507 argShowHelp(); 515 argShowHelp();
508 THERR("No filename(s) specified.\n"); 516 THERR("No filename(s) specified.\n");