From: Magnus Jacobsson Date: Sun, 20 Sep 2020 12:48:09 +0000 (+0200) Subject: Add option -? for usage to Windows version of dotty X-Git-Tag: 2.46.0~20^2^2~55^2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba35ab95f773d03cbcb3d403d99b0bbde9ccb57e;p=graphviz Add option -? for usage to Windows version of dotty --- diff --git a/cmd/dotty/mswin32/dotty.c b/cmd/dotty/mswin32/dotty.c index d92963c0b..ddaea5f6b 100644 --- a/cmd/dotty/mswin32/dotty.c +++ b/cmd/dotty/mswin32/dotty.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,8 @@ int APIENTRY WinMain ( char cmd[256]; char *path; char *s; + int argc; + LPWSTR *argv; ZeroMemory (&si, sizeof(si)); si.cb = sizeof(si); @@ -56,6 +59,11 @@ int APIENTRY WinMain ( if (!(path = buildpath ("lefty"))) exit (1); } + argv = CommandLineToArgvW(lpCmdLine, &argc); + if (argc == 1 && strcmp(argv[0], "-?") == 0) { + fprintf(stderr, "usage: dotty [-V] [-lm (sync|async)] [-el (0|1)] \n"); + exit(0); + } if (lpCmdLine[0] == 0) sprintf ( cmd, "%s -e \"load('dotty.lefty');%sdotty.init();dotty.createviewandgraph(null,'file',null,null);txtview('off');\"",