aboutsummaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cli.c b/src/cli.c
index c4499ff..24bace0 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -25,6 +25,7 @@
#include "common.h"
#include "help.h"
#include "log.h"
+#include "lua_state.h"
#include "state.h"
#include "str.h"
@@ -236,11 +237,17 @@ cli_result_t cli(int argc, char **argv) {
print_help();
return CLI_HELP_CALLED;
}
- if (!parse_flags(argc, argv))
- return CLI_FAIL;
- if (!parse_cmds(argc, argv))
+ init_lua_config();
+ init_lua_state();
+
+ if (!parse_flags(argc, argv)) {
+ free_lua_config();
return CLI_FAIL;
+ } else if (!parse_cmds(argc, argv)) {
+ free_lua_config();
+ return CLI_FAIL;
+ }
return CLI_SUCCESS;
}