majoros

jil and realine

Discussion created by majoros on Dec 14, 2012
The lack of support for things such as history, auto-completion, or even the backspace on interactive commands such as jil has always bothered me. Jil is not the only one, isql for Sybase, sqlplus for Oracle, runmqsc for IBM MQ the list goes on. I understand the licence issues with readline and closed source but I would think there would be an alternative that closed source software could use.

Thankfully there is rlwrap. Licencing is not an issue because the realine library is not actually linking with what it is wrapping. There separate processes.

This gives you...

[list]
[*]History
[*]Line editing
[*]auto-complete
[list]

All you need to do is put "rlwrap" befor the command you want to wrap. in this case jil. I set up an alias "alias jil='rlwrap jil'.

I also "export RLWRAP_HOME='/full/path/to/home/dir/.rlwrap/'" because i like to keep my home dir clean of clutter. ( full path tilda will not work )

For auto-completion you will need to put together a completion file. Its just a new line delimited list of words. Surprisingly enough the list of jill sub-commands and attributes was more difficult come come by than i thought. It involed converting the index of one of the r11 PDF manuals to text and then doing some grep and sed magic. I have attached a file with all 408 attributes and subcommands, I think i got them all. I don't have most of them in my file, I dont want 15 options coming up when i type "in<TAB> but for completion I added everything to this file. Just put the file in you RLWRAP_HOME directory.

(SIGH remove the .txt at the end)

Attachments

Outcomes