tags:

views:

175

answers:

3

I'm considering writing a console application in C# and I want to incorporate history, completion and command line editing features something like GNU readline (but not necessarily as extensive as that!)

Is there an existing library for .net which provides this type of functionality? I guess one option would be to use interop services to call GNU readline. But is there a native option?

+2  A: 

The only thing I know of is Mono-Readline.

It provides a .NET interface to the GNU Readline library - it's a bit raw though, only version 0.0.1, and I've only ever seen it run on the Mono runtime.

You should be careful with licensing too ... AFAIK anything that links the GNU Readline libraries is required to be released under the GPL.

Duncan Bayne
+1  A: 

a project that aims to emulate most of the functions of RedLine is Deveel ReadLine, but I have to say that it isn't maintained. Last time I used it it worked very well on both .NET and Mono, although there's a small bug when canceling a line that was automatically folded.

Antonello
+1  A: 

You may want to checkout Miguel de Icaza's getline.cs. Depending on what features of readline you actually need, it might be enough for your purposes.

The nice thing is, that it is all contained in a single (hence getline.cs) file and MIT X11 licensed.

Christian.K
I've tried the getline library from the CSharpRepl project, but has a limited support for the tab-completion. Also, the completion feature itself is quite difficult to implement.Maybe just my limits...
Antonello