changeset 23:832c26cb1637

Improve option handling.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Sep 2014 03:36:58 +0300
parents c89a20bce211
children 16d6b5029543
files sidinfo.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sidinfo.c	Thu Sep 25 02:50:03 2014 +0300
+++ b/sidinfo.c	Thu Sep 25 03:36:58 2014 +0300
@@ -477,7 +477,10 @@
 
     // Read PSID data
     if (siReadPSIDFile(inFile, &psid) != 0)
+    {
+        THERR("Error reading %s\n", filename);
         goto error;
+    }
 
     // Output
     siPrintPSIDInformation(stdout, optParsable, optHexadecimal, optFields, filename, &psid);
@@ -499,9 +502,14 @@
 
     // Parse command line arguments
     if (!th_args_process(argc, argv, optList, optListN,
-                         argHandleOpt, argHandleFile, FALSE))
+        argHandleOpt, argHandleFile, OPTH_ONLY_OPTS))
         return -1;
 
+    // Process files
+    if (!th_args_process(argc, argv, optList, optListN,
+        argHandleOpt, argHandleFile, OPTH_ONLY_OTHER))
+        return -2;
+
     if (optNFiles == 0)
     {
         argShowHelp();