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:
authorClement Farabet <clement.farabet@gmail.com>2014-07-07 06:34:18 +0400
committerClement Farabet <clement.farabet@gmail.com>2014-07-07 06:34:18 +0400
commit1ac6bdeccfde37c4689611bf67f46616bc0c1794 (patch)
tree060aac830f755ba62aba9e7b6c20d362078841c7
parent607818b4174e6fec532bc582c1fc44cd5ac33010 (diff)
warning (readline unfound)
-rw-r--r--init.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 0052892..cd0d360 100644
--- a/init.lua
+++ b/init.lua
@@ -359,6 +359,9 @@ _LAST = ''
-- Readline:
local readline_ok,readline = pcall(require,"trepl.readline")
+if not readline_ok then
+ print(col.red('WARNING: ') .. 'could not find/load readline, defaulting to linenoise')
+end
-- REPL:
function repl_readline()
@@ -528,14 +531,19 @@ end
-- No readline -> LineNoise?
local nextline
if not readline_ok then
+ print('ici')
-- Load linenoise:
local ok,L = pcall(require,'linenoise')
+ ok = false
if not ok then
-- No readline, no linenoise... default to plain io:
nextline = function()
io.write(prompt()) io.flush()
return io.read('*line')
end
+
+ -- Really poor:
+ print(col.red('WARNING: ') .. 'could not find/load linenoise, defaulting to raw repl')
else
-- History:
local history = os.getenv('HOME') .. '/.luahistory'