diff options
author | Steve Bennett <steveb@workware.net.au> | 2018-09-04 07:54:27 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2018-09-04 08:00:23 +1000 |
commit | 022f90263261694bbcb98373ad7e5a282ab74453 (patch) | |
tree | e37ad353b99c7a6a22dfd311dd849d6e1f36b658 | |
parent | 7e7af2944f2dfaa5398e88d49e2941e786a56925 (diff) | |
download | jimtcl-022f90263261694bbcb98373ad7e5a282ab74453.zip jimtcl-022f90263261694bbcb98373ad7e5a282ab74453.tar.gz jimtcl-022f90263261694bbcb98373ad7e5a282ab74453.tar.bz2 |
bootstrap package support
Allow minimal command "package" to take additional arguments, but ignore them.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | bootstrap.tcl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bootstrap.tcl b/bootstrap.tcl index f6c404f..c93ec9f 100644 --- a/bootstrap.tcl +++ b/bootstrap.tcl @@ -1,10 +1,14 @@ # Minimal support for package require # No error on failure since C extensions aren't handled -proc package {cmd pkg} { +proc package {cmd pkg args} { if {$cmd eq "require"} { foreach path $::auto_path { - if {[file exists $path/$pkg.tcl]} { - uplevel #0 [list source $path/$pkg.tcl] + set pkgpath $path/$pkg.tcl + if {$path eq "."} { + set pkgpath $pkg.tcl + } + if {[file exists $pkgpath]} { + uplevel #0 [list source $pkgpath] return } } |