aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordacctal <donotcontactmevia@email.invalid>2026-07-21 21:32:27 +0000
committerdacctal <donotcontactmevia@email.invalid>2026-07-21 21:32:27 +0000
commit184bd50e2ea12b4bf40f4ae1b0d685f0bfa1c995 (patch)
treebfe4f0a8fb39def302bdc807308c30b60dd18a92 /src/main.c
parentc251d37c98efba534766e914f7392cc7a0470351 (diff)
started 2.0 refactor. Co-authored-by: ezntek <eason@ezntek.com>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 341b7ad..0cba246 100644
--- a/src/main.c
+++ b/src/main.c
@@ -18,12 +18,28 @@
*/
-#include "parse_args.h"
-#include "globs.h"
+#include "cli.h"
+#include "lua_state.h"
int main(int argc, char **argv) {
- init_vars();
- parse_args(argc, argv);
- free_vars();
- return 0;
+ // if (!init_vars())
+ // return 1;
+
+ int retval = 0;
+ cli_result_t result = cli(argc, argv);
+ if (!result) {
+ retval = 1;
+ goto done;
+ }
+
+ if (result != CLI_HELP_CALLED) {
+ init_lua_state();
+ // if (!init_vars())
+ // return 1;
+ }
+
+done:
+ free_lua_state();
+ // free_vars();
+ return retval;
}