File: tclreadlineInit.tcl.in

package info (click to toggle)
tclreadline 2.3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,848 kB
  • sloc: tcl: 5,697; sh: 4,217; ansic: 720; makefile: 80
file content (40 lines) | stat: -rw-r--r-- 1,204 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# FILE: tclreadlineInit.tcl.in
# $Id: 4d98a82179464f209f4bb5c85a10cd0e958799a9 $
# ---
# tclreadline -- gnu readline for tcl
# https://github.com/flightaware/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

package provide tclreadline @VERSION@

namespace eval tclreadline:: {
    namespace export Init
}

proc ::tclreadline::Init {} {
    uplevel #0 {
        if {![info exists tclreadline::library]} {
            set msg ""
            foreach dirname {@TCLRL_LIBDIR@ [file dirname [info script]]} {
                if {[catch {load [file join $dirname libtclreadline[info sharedlibextension]]} msg] == 0} {
                    set msg ""
                    break
                }
            }
            if {$msg != ""} {
                puts stderr $msg
                exit 2
            }
        }
    }
}

tclreadline::Init
::tclreadline::readline customcompleter ::tclreadline::ScriptCompleter

source [file join [file dirname [info script]] tclreadlineSetup.tcl]

set auto_index(::tclreadline::ScriptCompleter) \
    [list source [file join [file dirname [info script]] tclreadlineCompleter.tcl]]