]> granicus.if.org Git - graphviz/commitdiff
Show usage and exit non-zero for unsupported option in gvedit
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sat, 3 Oct 2020 13:59:40 +0000 (15:59 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Thu, 8 Oct 2020 19:10:25 +0000 (21:10 +0200)
Towards https://gitlab.com/graphviz/graphviz/-/issues/1843.

cmd/gvedit/main.cpp

index 0901e5e3a2642017b9386beebdf09bebd5d25894..b10624ab413964a7abe80ee7e16ccede8db715ef 100644 (file)
@@ -68,9 +68,11 @@ static char **parseArgs(int argc, char *argv[])
        case '?':
            if (optopt == '\0')
                usage(0);
-           else
+           else {
                errout << cmd << " : option -" << ((char) optopt) <<
-                   " unrecognized - ignored\n" << flush;
+                   " unrecognized\n" << flush;
+               usage(1);
+           }
            break;
        }
     }