Skip to content

orocos-toolchain/rttlua_completion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Tab Completion module for rttlua

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published