On a project I'm working on, I'm trying to make it accept user commands and provide history with the up arrow. I'm aiming to keep this project free of dependencies, and I don't want to have to require people to also install the readline development files just to compile my project. Does anyone know of a simple drop-in replacement for GNU Readline that provides only simple functionality?
GNU Readline is a software library that provides in-line editing and history capabilities for interactive programs with a command-line interface, such as Bash. It is currently maintained by Chet Ramey as part of the GNU Project. GNU Readline.
Readline provides commands for searching through the command history for lines containing a specified string. There are two search modes: incremental and non-incremental. Incremental searches begin before the user has finished typing the search string.
Readline is shipped as a standard library on most GNU/Linux and FreeBSD systems. It's also part of the NetBSD packages collection and the OpenBSD packages collection. The OpenPKG project makes source RPMs of readline-8.0 available for a variety of Unix and Linux systems as a base part of the current release.
Editline. It has a BSD-style license.
EDIT: Older versions of editline were quite simple. Here's one with just two C files and a header, a total of about 1500 lines of code. We've been using it for years.
I found one. antirez of Redis fame has come up with linenoise, a much simpler alternative.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With