Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (10 sloc) 339 Bytes
require 'readline'
while line = Readline.readline('> ', history = true)
break if line =~ /^(quit|exit)$/
puts "You typed: #{line.inspect}"
end
puts "Bye!"
# completion
require 'abbrev'
Completors = %w[hello world of nifty_completion]
Readline.completion_proc = lambda{|tok| Completors.abbrev[tok] }