]> granicus.if.org Git - graphviz/commitdiff
Fix gvpr -? to actually print usage and exit non-zero
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 22 Nov 2020 10:55:53 +0000 (11:55 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 16 Feb 2021 07:24:19 +0000 (08:24 +0100)
CHANGELOG.md
lib/gvpr/gvpr.c

index 7c24a4a954917041440b4e347f28576794f693a5..efb26bebcb011b5f5bd3a1d2c9a2761de4f78f42 100644 (file)
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - The edges in JSON output are ordered now !1728
 
 ### Fixed
+- Fix gvpr -? to actually print usage and exit non-zero
 - gvpr is not built by CMake #1878
 - typos in gpcanvas.c #1927
 - memory leak in libmingle
index c7dd5ed11b5a7484124eab510891f0f934750b86..9112b10c0b2d0ee51019feb5f228b1bbab212c66 100644 (file)
@@ -358,7 +358,11 @@ doFlags(char* arg, int argi, int argc, char** argv, options* opts)
            return 0;
            break;
        case '?':
-           error(ERROR_USAGE|ERROR_WARNING, "%s", usage);
+           if (optopt == '\0' || optopt == '?')
+               fprintf(stderr, "Usage: gvpr%s", usage);
+           else {
+               error(ERROR_USAGE|ERROR_WARNING, "%s", usage);
+           }
            return 0;
            break;
        default :