You are here

tclreadline 2.1.0

admin의 아바타

홈페이지 : http://tclreadline.sourceforge.net/

readline이란 커맨드 라인의 편집 기능을 제공한 라이브러리 입니다.
예를 들면, bash쉘에 있어서 문자를 입력했을때 화살표키로 입력한 커맨드를 다시 사용할수 있게 가능케 하는 것입니다.
이 라이브러리는 대화적 쉘로 동작하는 것을 목적으로하는 프로그램을 만들때 자주사용합니다.

The tclreadline package makes the GNU Readline library available for interactive tcl shells. This includes history expansion and file/command completion. Command completion for all tcl/tk commands is provided and commmand completers for user defined commands can be easily added. tclreadline can also be used for tcl scripts which want to use a shell like input interface. In this case the ::tclreadline::readline read command has to be called explicitly.
The advantage of tclreadline is that it uses the callback handler mechanism of the gnu readline while it processes tcl events. This way X events from a wish gui will processed as well as events from the tclreadline line interface.

tclreadline consists basically of a shared library and a few tcl scripts which are accessed with the tcl package require command. Therefore tclreadline works together with all common extensions like blt, itcl, itk, tix .... Further information can be found in the README file and the unix man page.

#!/bin/sh
# FILE: "/home/joze/src/tclreadline/sample.tclshrc"
# LAST MODIFICATION: "Thu, 23 Mar 2000 21:13:08 +0100 (joze)"
# (C) 1998 - 2000 by Johannes Zellner, 
# $Id: sample.tclshrc,v 1.1 2000/07/02 16:30:25 joze Exp $
# vim:set ft=tcl: 
exec tclsh "$0" "$@"


if {$tcl_interactive} {

    package require tclreadline

    # uncomment the following if block, if you
    # want `ls' executed after every `cd'. (This was
    # the default up to 0.8 == tclreadline_version.)
    #
    # if {"" == [info procs cd]} {
    #     catch {rename ::tclreadline::Cd ""}
    #     rename cd ::tclreadline::Cd
    #     proc cd {args} {
    #         if {[catch {eval ::tclreadline::Cd $args} message]} {
    #             puts stderr "$message"
    #         }
    #         tclreadline::ls
    #     }
    # }

    # uncomment the following line to use
    # tclreadline's fancy ls proc.
    #
    # namespace import tclreadline::ls

    # tclreadline::Print is on (`yes') by default.
    # This mimics the command echoing like in the
    # non-readline interactive tclsh.
    # If you don't like this, uncomment the following
    # line.
    #
    # tclreadline::Print no

    # uncomment the folling line, if you want
    # to change tclreadline's print behaviour
    # frequently with less typing.
    #
    # namespace import tclreadline::Print

    # store maximal this much lines in the history file
    #
    set tclreadline::historyLength 200

    # disable tclreadline's script completer
    #
    # ::tclreadline::readline customcompleter ""

    # go to tclrealdine's main loop.
    #
    tclreadline::Loop
}
첨부 파일파일 크기
Image icon album_pic.jpg9.93 KB
Binary Data tclreadline-2.1.0.tar.gz156.78 KB