]> granicus.if.org Git - graphviz/commitdiff
Add option -? for usage to Windows version of lneato
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Sun, 20 Sep 2020 12:52:03 +0000 (14:52 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Fri, 2 Oct 2020 12:47:15 +0000 (14:47 +0200)
cmd/lneato/mswin32/lneato.c

index 1683b651645735be7292ac6ec6b2e6fb6896e688..553617a5ba85dbc4cff0ef946b37fbab5ab6934f 100644 (file)
@@ -18,6 +18,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <shellapi.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -32,6 +33,8 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
     char cmd[256];
     char *path;
     char *s;
+    int argc;
+    LPWSTR *argv;
 
     shellpath = getenv ("PATH");
     if (!shellpath || !(path = buildpath ("lefty"))) {
@@ -43,6 +46,11 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
         if (!(path = buildpath ("lefty")))
             exit (1);
     }
+    argv = CommandLineToArgvW(lpCmdLine, &argc);
+    if (argc == 1 && strcmp(argv[0], "-?") == 0) {
+        fprintf(stderr, "usage: lneato [-V] [-lm (sync|async)] [-el (0|1)] <filename>\n");
+        exit(0);
+    }
     if (lpCmdLine[0] == 0)
         sprintf (cmd, "%s -e \"load('dotty.lefty');dotty.protogt.lserver='neato';dotty.simple(null);\"", path);
     else