changeset 2567:b205c60aa657

More error handling/help stuff.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 28 Feb 2022 12:03:23 +0200
parents d75431bf1a7d
children 8ab923fe23ef
files tools/fanalyze.c tools/mod2wav.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tools/fanalyze.c	Mon Feb 28 11:59:26 2022 +0200
+++ b/tools/fanalyze.c	Mon Feb 28 12:03:23 2022 +0200
@@ -674,11 +674,13 @@
     // Parse arguments
     if (!dmArgsProcess(argc, argv, optList, optListN,
         argHandleOpt, argHandleNonOpt, OPTH_BAILOUT))
-        exit(1);
+        goto out;
 
     if (nsrcFiles < 1)
     {
         argShowHelp();
+        res = dmError(DMERR_INVALID_ARGS,
+            "No input file(s) specified.\n");
         goto out;
     }
 
--- a/tools/mod2wav.c	Mon Feb 28 11:59:26 2022 +0200
+++ b/tools/mod2wav.c	Mon Feb 28 12:03:23 2022 +0200
@@ -243,6 +243,7 @@
     // Check arguments
     if (optInFilename == NULL || optOutFilename == NULL)
     {
+        argShowHelp();
         res = dmError(DMERR_INVALID_ARGS,
             "Input or output file not specified.\n");
         goto out;