From ba35ab95f773d03cbcb3d403d99b0bbde9ccb57e Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sun, 20 Sep 2020 14:48:09 +0200 Subject: [PATCH] Add option -? for usage to Windows version of dotty --- cmd/dotty/mswin32/dotty.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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');\"", -- 2.50.1