Skip to content
Readline tab completion example for a blog post
C Ruby Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Makefile
README.md
main.c
main.rb

README.md

Readline example

Example code for a series of blog post introducing tab completion in GNU Readline.

For more, see the blog posts:

Running the C code

Compile and run the code with:

make
./rdemo

The defaults in the Makefile are set up for an OS X system with Readline installed via homebrew to /usr/local/opt. You can override these settings with the appropriate values for your system by setting the CC, CFLAGS and LDFLAGS environment variables (see the Makefile for example values).

Running the Ruby code

The Ruby version demonstrates two Ruby patches that need to be applied before the code will run:

At the time of writing, #12659 is already in trunk and the 2.4 preview builds. #13050 hasn't been accepted yet, but may make it before 2.4 final.

Once you have a properly patched version of Ruby, you can run:

ruby main.rb
You can’t perform that action at this time.