Diff
Not logged in

Differences From Artifact [4dfd34c126]:

To Artifact [4d1fefee5e]:


1
2
3
4
5
6
7
8
9
10
#!/usr/locanl/bin/tclsh
# FILE: "/disk01/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
# LAST MODIFICATION: "Wed Sep 15 15:23:30 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#


|







1
2
3
4
5
6
7
8
9
10
#!/usr/locanl/bin/tclsh
# FILE: "/disk01/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
# LAST MODIFICATION: "Thu Sep 16 18:06:23 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
		}
	}
	return -code error "invalid command name \"$name\""
}

namespace eval tclreadline {

namespace export Setup Glob Loop InitTclCmds InitTkCmds Print ls

proc ls {args} {
	if {[exec uname -s] == "Linux"} {
		eval exec ls --color -FC [Glob $args]
	} else {
		eval exec ls -FC [Glob $args]
	}







|







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
		}
	}
	return -code error "invalid command name \"$name\""
}

namespace eval tclreadline {

namespace export Setup Loop InitTclCmds InitTkCmds Print ls

proc ls {args} {
	if {[exec uname -s] == "Linux"} {
		eval exec ls --color -FC [Glob $args]
	} else {
		eval exec ls -FC [Glob $args]
	}
201
202
203
204
205
206
207


208
209
210
211
212
213
214

				if {[catch {
					::tclreadline::readline write \
					[::tclreadline::HistoryFileGet]
				} ::tclreadline::errorMsg]} {
					puts stderr $::tclreadline::errorMsg
				}



				if [catch "eval ::tclreadline::Exit $args" message] {
					puts stderr "error:"
					puts stderr "$message"
				}
				# NOTREACHED
			}







>
>







201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216

				if {[catch {
					::tclreadline::readline write \
					[::tclreadline::HistoryFileGet]
				} ::tclreadline::errorMsg]} {
					puts stderr $::tclreadline::errorMsg
				}

				::tclreadline::readline reset-terminal

				if [catch "eval ::tclreadline::Exit $args" message] {
					puts stderr "error:"
					puts stderr "$message"
				}
				# NOTREACHED
			}
245
246
247
248
249
250
251


252
253
254
255
256
257
258
}

proc HistoryFileGet {} {
	variable historyfile
	return $historyfile
}



proc Glob {string} {

	set commandstring ""
	foreach name $string {
		set replace [glob -nocomplain -- $name]
		if {$replace == ""} {
			lappend commandstring $name







>
>







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
}

proc HistoryFileGet {} {
	variable historyfile
	return $historyfile
}

# obsolete
#
proc Glob {string} {

	set commandstring ""
	foreach name $string {
		set replace [glob -nocomplain -- $name]
		if {$replace == ""} {
			lappend commandstring $name