Diff
Not logged in

Differences From Artifact [a07d7cee03]:

To Artifact [e34a842808]:


1
2
3
4
5
6
7
8
9
10
...
490
491
492
493
494
495
496

497
498

499
500






501
502
503

504
505
506
507
508
509
510
# -*- tclsh -*-
# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Sat, 25 Mar 2000 21:28:45 +0100 (joze)"
# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# vim:set ts=4:
# ---
#
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
................................................................................
	# We always use `configure' here,
	# because cget will not return the
	# option table.
	#
	if {[catch [list set option_table [eval ${cmd} configure]] msg]} {
		return 0
	}

	foreach optline ${option_table} {
		if {5 != [llength ${optline}]} continue else {

			lappend options(switches) [lindex ${optline} 0]
			lappend options(value)    [lindex ${optline} 4]






		}
	}
	return [llength ${option_table}]

}

#**
# try to complete a `cmd configure|cget ..' from the command's options.
# @param   text start line cmd, standard tclreadlineCompleter arguments.
# @return  -- a flag indicating, if (cget|configure) was found.
# @return  resultT -- a tclreadline completer formatted string.


|







 







>

|
>


>
>
>
>
>
>


<
>







1
2
3
4
5
6
7
8
9
10
...
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510

511
512
513
514
515
516
517
518
# -*- tclsh -*-
# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Sat, 01 Jul 2000 16:15:55 +0200 (joze)"
# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# vim:set ts=4:
# ---
#
# tclreadline -- gnu readline for tcl
# http://www.zellner.org/tclreadline/
................................................................................
	# We always use `configure' here,
	# because cget will not return the
	# option table.
	#
	if {[catch [list set option_table [eval ${cmd} configure]] msg]} {
		return 0
	}
	set retval 0
	foreach optline ${option_table} {
		if {5 == [llength ${optline}]} {
			# tk returns a list of length 5
			lappend options(switches) [lindex ${optline} 0]
			lappend options(value)    [lindex ${optline} 4]
			incr retval
		} elseif {3 == [llength ${optline}]} {
			# itcl returns a list of length 3
			lappend options(switches) [lindex ${optline} 0]
			lappend options(value)    [lindex ${optline} 2]
			incr retval
		}
	}

	return $retval
}

#**
# try to complete a `cmd configure|cget ..' from the command's options.
# @param   text start line cmd, standard tclreadlineCompleter arguments.
# @return  -- a flag indicating, if (cget|configure) was found.
# @return  resultT -- a tclreadline completer formatted string.