-
Notifications
You must be signed in to change notification settings - Fork 25
/
tclreadlineInit.tcl.in
40 lines (34 loc) · 1.15 KB
/
tclreadlineInit.tcl.in
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$
# ---
# 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 [list @TCLRL_LIBDIR@ [file dirname [info script]]] {
if {[catch {load [file join $dirname libtclreadline[info sharedlibextension]] Tclreadline} 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]]