From 0a756175baa7076bc74223cb9bfe6ac801776fb0 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 2 Sep 2021 12:25:29 +1000 Subject: Move initial option parsing to begining. --- src/sledjchisl/sledjchisl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 3bd1a3b..334f6b9 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -8166,6 +8166,27 @@ void sledjchisl_main(void) configs = qhashtbl(0, 0); L = luaL_newstate(); + if (0 == toys.optc) + ; + else if (strcmp(toys.optargs[0], "backup") == 0) + currentMode = BACKUP; + else if (strcmp(toys.optargs[0], "gitar") == 0) + currentMode = GITAR; + else if (strcmp(toys.optargs[0], "restart") == 0) + currentMode = RESTART; + else if (strcmp(toys.optargs[0], "start") == 0) + currentMode = START; + else if (strcmp(toys.optargs[0], "status") == 0) + currentMode = STATUS; + else if (strcmp(toys.optargs[0], "build") == 0) + currentMode = BUILD; + else if (strcmp(toys.optargs[0], "test") == 0) + currentMode = TEST; + else if (strcmp(toys.optargs[0], "update") == 0) + currentMode = UPDATE; + else if (strcmp(toys.optargs[0], "stop") == 0) + currentMode = STOP; + V("libfcgi version: %s", FCGI_VERSION); V("Lua version: %s", LUA_RELEASE); V("LuaJIT version: %s", LUAJIT_VERSION); -- cgit v1.1