summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/char/char.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/char/char.c b/src/char/char.c
index cf2f7d87c..613a3deec 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -5758,11 +5758,25 @@ static CMDLINEARG(netconfig)
chr->NET_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;
+}
+
/**
* Initializes the command line arguments handlers.
*/
void cmdline_args_init_local(void)
{
+ CMDLINEARG_DEF2(run-once, runonce, "Closes server after loading (testing).", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF2(char-config, charconfig, "Alternative char-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(inter-config, interconfig, "Alternative inter-server configuration.", CMDLINE_OPT_PARAM);
CMDLINEARG_DEF2(net-config, netconfig, "Alternative network configuration.", CMDLINE_OPT_PARAM);