linuxcnc/scripts/haltcl.in
Dewey Garrett b03ca613f9 twopass.tcl loadusr in pass0
An out-of-tree application uses a realtime component (lcec)
that depends on loading of a user component (lcec_conf).

This commit causes any loadusr directive to execute in the
initial pass so if wait (-w) is specified, the user component
should be ready before any loadrt.
2019-01-25 16:34:08 -07:00

43 lines
800 B
Text

#!@TCLSH@
package require Linuxcnc
if { [llength $argv] > 0 \
&& ( ([lindex $argv 0] == "-i") || ([lindex $argv 0] == "-ini") )} {
parse_ini [lindex $argv 1]
set argv [lrange $argv 2 end]
}
proc setp {p v} {
set v [uplevel [list expr $v]]
hal setp $p $v
}
proc sets {p v} {
set v [uplevel [list expr $v]]
hal sets $p $v
}
foreach c [hal --commands] {
if {[info commands $c] == {}} {
proc $c args "eval hal $c \$args"
}
}
proc show args {puts [eval hal show $args]}
if {[llength $argv] == 0} {
package require tclreadline
namespace eval tclreadline {
proc prompt1 {} {
return "haltcl: "
}
}
::tclreadline::Loop
}
set filename [lindex $argv 0]
set argv [lrange $argv 1 end]
set result [source $filename]