diff options
| author | 2024-09-07 23:39:31 -0400 | |
|---|---|---|
| committer | 2024-09-07 23:39:31 -0400 | |
| commit | c638ce83c6b82fb47ec5856ea24065257c722458 (patch) | |
| tree | cbcbdf32f3cc4a7ff99742c8d002bb6f61b7ac0c /src/lush.c | |
| parent | fixed error in install.sh instructions (diff) | |
added --version flag
Diffstat (limited to '')
| -rw-r--r-- | src/lush.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -567,7 +567,14 @@ int lush_run(lua_State *L, char ***commands, int num_commands) { return lush_execute_pipeline(commands, num_commands); } -int main() { +int main(int argc, char *argv[]) { + // check if the --version arg was passed + if (argc > 1 && strcmp(argv[1], "--version") == 0) { +#ifdef LUSH_VERSION + printf("Lunar Shell, version %s\n", LUSH_VERSION); +#endif + return 0; + } lua_State *L = luaL_newstate(); luaL_openlibs(L); lua_register_api(L); @@ -628,4 +635,5 @@ int main() { free(line); } lua_close(L); + return 0; } |
