File: shell.lua

package info (click to toggle)
eja 9.5.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 1,340 kB
  • ctags: 3,142
  • sloc: ansic: 15,010; makefile: 255
file content (22 lines) | stat: -rw-r--r-- 415 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- Copyright (C) 2007-2014 by Ubaldo Porcheddu <ubaldo@eja.it>


eja.lib.shell='ejaShell'
eja.help.shell='interactive shell'


function ejaShell()
 if eja.opt.shell == '' then
  while true do 
   io.stderr:write("> ");
   local ejaShellInput=io.read()
   if ejaShellInput and ejaShellInput ~= ".quit" then
    loadstring(ejaShellInput)()
   else 
    break
   end
  end
 else
  loadstring(eja.opt.shell)()
 end
end