]> granicus.if.org Git - graphviz/commitdiff
Allow lefty -? to show usage even if there's no DISPLAY (FEATURE_X11)
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Tue, 8 Sep 2020 22:58:36 +0000 (00:58 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 11 Sep 2020 06:01:42 +0000 (08:01 +0200)
Parse lefty args before starting app and trying to open DISPLAY. This
allows testing that lefty can start in CI.

This change only affects the X11 variant (FEATURE_X11 or FEATURE_NONE
defined), not the Windows variant.

cmd/lefty/lefty.c

index 0b3a0edd2799254787de8174ca7fb27e596d0f85..633d9a20a9cffa2d74665eb7bfa00829be1e9b91 100644 (file)
@@ -102,6 +102,11 @@ int main (int argc, char **argv) {
     exprstr = NULL;
     fp = NULL;
     init (argv[0]);
+
+    processstr (leftyoptions);
+    argv++, argc--;
+    processargs (argc, argv);
+
     Minit (GFXprune);
     Ginit ();
     FD_SET (Gxfd, &inputfds);
@@ -111,10 +116,6 @@ int main (int argc, char **argv) {
     Eshowbody = 1;
     Eshowcalls = 1;
 
-    processstr (leftyoptions);
-    argv++, argc--;
-    processargs (argc, argv);
-
     if (setjmp (exitljbuf))
         goto eop;