Module Readline
In: lib/readline.rb

encoding: US-ASCII

readline.rb — GNU Readline module Copyright (C) 1997-2001 Shugo Maeda

Ruby translation by Park Heesob phasis@gmail.com

Methods

Included Modules

RbReadline

Classes and Modules

Class Readline::Fcomp
Class Readline::History
Class Readline::Ucomp

Constants

HISTORY = History
FILENAME_COMPLETION_PROC = Fcomp
USERNAME_COMPLETION_PROC = Ucomp
VERSION = RbReadline.rl_library_version

Public Class methods

Returns the list of quote characters that can cause a word break. The default is "’\"" (single and double quote characters).

Sets the list of quote characters that can cause a word break.

Returns the character string that signal a break between words for the completion proc. The default is " \t\n\"\’`@$><=|&{(".

Sets the character string that signal a break between words for the completion proc.

Returns the list of characters that can be used to quote a substring of the line, i.e. a group of characters inside quotes.

Sets the list of characters that can be used to quote a substring of the line, i.e. a group of characters within quotes.

Returns the character string that signal the start or end of a word for the completion proc.

Sets the character string that signal the start or end of a word for the completion proc.

Returns the character that is automatically appended after the Readline.completion_proc method is called.

Sets the character that is automatically appended after the Readline.completion_proc method is called.

If char is nil or empty, then a null character is used.

Returns whether or not the completion proc is case sensitive. The default is false, i.e. completion procs are case sensitive.

Sets whether or not the completion proc should ignore case sensitivity. The default is false, i.e. completion procs are case sensitive.

Returns the current auto-completion procedure.

Sets the auto-completion procedure (i.e. tab auto-complete).

The proc argument is typically a Proc object. It must respond to .call, take a single String argument and return an Array of candidates for completion.

Example:

   list = ['search', 'next', 'clear']
   Readline.completion_proc = proc{ |s| list.grep( /^#{Regexp.escape(s)}/) }

Sets emacs editing mode

Returns the character string used to indicate quotes for the filename completion of user input.

Sets the character string of one or more characters that indicate quotes for the filename completion of user input.

Sets the input stream (an IO object) for readline interaction. The default is $stdin.

Returns current line buffer

Sets the output stream (an IO object) for readline interaction. The default is $stdout.

Returns the current offset in the current input line.

Returns nil if no matches are found or an array of strings:

  [0] is the replacement for text
  [1..n] the possible matches
  [n+1] nil

The possible matches should not include [0].

If this method sets RbReadline.rl_attempted_completion_over to true, then the default completion function will not be called when this function returns nil.

Sets vi editing mode.

Public Instance methods

Begins an interactive terminal process using prompt as the command prompt that users see when they type commands. The method returns the line entered whenever a carriage return is encountered.

If an add_history argument is provided, commands entered by users are stored in a history buffer that can be recalled for later use.

Note that this method depends on $stdin and $stdout both being open. Because this is meant as an interactive console interface, they should generally not be redirected.

If you would like to add non-visible characters to the the prompt (for example to add colors) you must prepend the character \001 (^A) before each sequence of non-visible characters and add the character \002 (^B) after, otherwise line wrapping may not work properly.

Example:

   loop{ Readline.readline('> ') }

[Validate]