diff options
author | Soumith Chintala <soumith@fb.com> | 2015-10-25 21:03:23 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@fb.com> | 2015-10-25 21:03:23 +0300 |
commit | 41bcde3c7599f76aa677c7269d131c04f1fc74a1 (patch) | |
tree | e9eec4b013909db9b5c96497c7681a8969e724d3 | |
parent | ae5678dbf265ca78b3fd471c8a7ffc4437f45b4d (diff) |
replacing os.exit with return so that lua state is properly closed
-rw-r--r-- | th | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -52,7 +52,7 @@ for _,arg in ipairs(parg) do -- help if shortopt == 'h' or option == 'help' then print(help) - os.exit() + return elseif shortopt == 'i' or option == 'interactive' then interactive = true elseif shortopt == 'e' then @@ -73,7 +73,7 @@ for _,arg in ipairs(parg) do -- unknown print('Error: unrecognized flag --' .. option) print(help) - os.exit() + return end else -- exec program @@ -119,10 +119,10 @@ if statement then local ok,res = pcall(s) if not ok then print(res) - os.exit() + return end -- quit by default - if not interactive then os.exit() end + if not interactive then return end end -- run program @@ -132,7 +132,7 @@ if run then -- run dofile(run) -- quit by default - if not interactive then os.exit() end + if not interactive then return end end -- start repl |