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@gmail.com>2015-03-16 23:28:20 +0300
committerSoumith Chintala <soumith@gmail.com>2015-03-16 23:28:20 +0300
commit61a01e18e67533157a79d5e4d7c7543e4cfd3a22 (patch)
tree35b80c4c65abdf43e4f7cfaa72bb5ea57c1d9d72
parent34f9adcdd3d405cf76d5e0db9ae73409570f9b97 (diff)
parent9e1bcff0dfbf1bf259397da76271242c7daf0efc (diff)
Merge pull request #18 from torch/better-help
adding back selfhelp
-rw-r--r--init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 6918b51..0c8b49b 100644
--- a/init.lua
+++ b/init.lua
@@ -573,7 +573,10 @@ function repl()
-- Shortcut to get help:
if line and line:find('^%s-?') then
- if dok_loaded_ok then
+ if line:gsub('^%s-?','') == '' then
+ print(selfhelp)
+ line = nil
+ elseif dok_loaded_ok then
line = 'help(' .. line:gsub('^%s-?','') .. ')'
else
print('error: could not load help backend')