From: Magnus Jacobsson Date: Sun, 20 Sep 2020 12:52:03 +0000 (+0200) Subject: Add option -? for usage to Windows version of lneato X-Git-Tag: 2.46.0~20^2^2~55^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ed4b99b1678b8e5a8afac198a0a341c18a93a0c;p=graphviz Add option -? for usage to Windows version of lneato --- diff --git a/cmd/lneato/mswin32/lneato.c b/cmd/lneato/mswin32/lneato.c index 1683b6516..553617a5b 100644 --- a/cmd/lneato/mswin32/lneato.c +++ b/cmd/lneato/mswin32/lneato.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -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)] \n"); + exit(0); + } if (lpCmdLine[0] == 0) sprintf (cmd, "%s -e \"load('dotty.lefty');dotty.protogt.lserver='neato';dotty.simple(null);\"", path); else