Skip to content
Browse files

Added code to call wibble by package require

  • Loading branch information...
1 parent dc2538a commit af961f3939ea8e05d0975c0ad0218dabbbecf3f0 dz committed Oct 7, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 example.tcl
  2. 0 wibble.tcl
View
9 example.tcl 100644 → 100755
@@ -1,4 +1,5 @@
-source wibble.tcl
+lappend auto_path .
+package require wibble
# =============================== example code ================================
@@ -17,9 +18,11 @@ if {$argv0 eq [info script]} {
::wibble::handle / dirlist root $root
::wibble::handle / notfound
- # Start a server and enter the event loop.
+ # Start a server and enter the event loop if not already there.
catch {
::wibble::listen 8080
- vwait forever
+ if {!$tcl_interactive} {
+ vwait forever
+ }
}
}
View
0 wibble.tcl 100644 → 100755
File mode changed.

0 comments on commit af961f3

Please sign in to comment.
Something went wrong with that request. Please try again.