본문으로 바로가기

tclreadline 2.1.0

category 확장 패키지 (Extension Package) 2024. 8. 13. 14:46

홈페이지 : 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
}

tclreadline-2.1.0.tar.gz
0.15MB

'확장 패키지 (Extension Package)' 카테고리의 다른 글

Supertext  (0) 2024.08.13
ttd  (0) 2024.08.13
TkTreeCtrl 2.2.10  (0) 2024.08.13
tkanalog 1.2.2  (0) 2024.08.13
FTP Library Package 1.2  (0) 2024.08.13