Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/trepl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2015-10-25 21:03:23 +0300
committerSoumith Chintala <soumith@fb.com>2015-10-25 21:03:23 +0300
commit41bcde3c7599f76aa677c7269d131c04f1fc74a1 (patch)
treee9eec4b013909db9b5c96497c7681a8969e724d3
parentae5678dbf265ca78b3fd471c8a7ffc4437f45b4d (diff)
replacing os.exit with return so that lua state is properly closed
-rw-r--r--th10
1 files changed, 5 insertions, 5 deletions
diff --git a/th b/th
index 2722690..f5e82b4 100644
--- a/th
+++ b/th
@@ -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