From: Magnus Jacobsson Date: Tue, 8 Sep 2020 22:58:36 +0000 (+0200) Subject: Allow lefty -? to show usage even if there's no DISPLAY (FEATURE_X11) X-Git-Tag: 2.46.0~20^2^2~87^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38fb5456d0d2909609deefe9c950c31bb33dca54;p=graphviz Allow lefty -? to show usage even if there's no DISPLAY (FEATURE_X11) 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. --- diff --git a/cmd/lefty/lefty.c b/cmd/lefty/lefty.c index 0b3a0edd2..633d9a20a 100644 --- a/cmd/lefty/lefty.c +++ b/cmd/lefty/lefty.c @@ -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;