/cpp-readline

A very simple C++ wrapper for GNU readline.

Primary LanguageC++GNU General Public License v3.0GPL-3.0

cpp-readline

This is a very simple library that wraps GNU readline into a C++ reusable class, hiding all the global state of the readline library. It is meant to help you interface really easily with your programs, while waiting for a more powerful solution (or improving this library itself for your needs).

Features

The main features of this library are:

  • Easy adding of custom commands
  • Automatic completion of commands and filenames.
  • Can run files containing lists of commands automatically.
  • Multiple separate Consoles can be run at the same time, bypassing the readline library global state.

Requirements

The library currently requires support for C++11, and, of course, the readline library.

Building

This repository includes a very simple makefile to build the provided example, but since the library is a single class you can simply include it directly into your project and compile it with the rest, without creating a library file.

The makefile default compiler is g++, if you are using a different compiler simply change the parameters to suit you (or compile manually, it's really just three files).

Usage

This library's usage can easily be seen in the file example/main.cpp.