summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c
index d7c7321d8..49508d564 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1671,6 +1671,19 @@ static CMDLINEARG(loginconfig)
login->LOGIN_CONF_NAME = aStrdup(params);
return true;
}
+
+/**
+ * --run-once handler
+ *
+ * Causes the server to run its loop once, and shutdown. Useful for testing.
+ * @see cmdline->exec
+ */
+static CMDLINEARG(runonce)
+{
+ core->runflag = CORE_ST_STOP;
+ return true;
+}
+
/**
* --net-config handler
*
@@ -1688,6 +1701,7 @@ static CMDLINEARG(netconfig)
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(login-config, loginconfig, "Alternative login-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative subnet configuration.", CMDLINE_OPT_PARAM);
}