aboutsummaryrefslogtreecommitdiff
path: root/nshelper.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'nshelper.tcl')
-rw-r--r--nshelper.tcl14
1 files changed, 14 insertions, 0 deletions
diff --git a/nshelper.tcl b/nshelper.tcl
index 9e617b7..499022e 100644
--- a/nshelper.tcl
+++ b/nshelper.tcl
@@ -143,3 +143,17 @@ proc {namespace upvar} {ns args} {
}
tailcall {*}$script
}
+
+proc {namespace ensemble} {subcommand args} {
+ if {$subcommand ne "create"} {
+ return -code error "only \[namespace ensemble create\] is supported"
+ }
+ set ns [uplevel 1 namespace canon]
+ set cmd $ns
+ if {$ns eq ""} {
+ return -code error "namespace ensemble create: must be called within a namespace"
+ }
+
+ # Create the mapping
+ ensemble $cmd -automap ${ns}:: {*}$args
+}