# HG changeset patch # User Matti Hamalainen # Date 1411605418 -10800 # Node ID 832c26cb1637592b9828cfbc653670db5a00d031 # Parent c89a20bce211d3c4017dc0761ef6c1b201ddb4a0 Improve option handling. diff -r c89a20bce211 -r 832c26cb1637 sidinfo.c --- 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();