-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
79 lines (50 loc) · 1.76 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Completion and History support for the rttlua shell
===================================================
INSTALL
-------
Provided you have libreadline installed, running
$ make
should build the two modules involved:
- complete.lua
- readline.so
SETUP
-----
Add the build directory to your LUA_PATH and LUA_CPATH:
$ export LUA_PATH=";;;$HOME/src/git/rttlua_completion/?.lua;$LUA_PATH"
$ export LUA_CPATH=";;;$HOME/src/git/rttlua_completion/?.so;$LUA_CPATH"
Note that in virtually all cases, you want your LUA_PATH and
LUA_CPATH variables to start with ';;;', which means: search
standard system paths as well.
RUNNING
-------
either run rttlua as follows:
$ rttlua-gnulinux -lcomplete -lreadline
or put the following line in your ~/.rttlua file
require "complete"
require "readline"
When you're in the Lua shell, hit tab to get possible completions.
HISTORY SUPPORT
---------------
The following command line history related commands are provided in
the 'readline' module:
| function | description |
|-------------------------+------------------------------------------|
| add_history(string) | add a string to the history |
| read_history(filename) | read the history from the given filename |
| write_history(filename) | write the current history to a file |
For example, you can put this command snippet
in your ~/.rttlua file:
if io.open(".rttlua_history") then
io:close()
read_history(".rttlua_history")
end
There is currently no mechanism to automatically save the history.
BUGS
----
The completion is not very smart regarding RTT, i.e. in the following
it will not smartly complete the known types:
rtt.Variable("
Patches to fix this are welcome.
LICENSE
-------
Licensed under the MIT License.