Index: library/nx/nx.tcl =================================================================== diff -u -r09b4bca7c8d5c44f6be0b2c04ebfcdb7a58fd5ae -r6a609930f16d6c18b3a938aecb2d2659c6a9bb8a --- library/nx/nx.tcl (.../nx.tcl) (revision 09b4bca7c8d5c44f6be0b2c04ebfcdb7a58fd5ae) +++ library/nx/nx.tcl (.../nx.tcl) (revision 6a609930f16d6c18b3a938aecb2d2659c6a9bb8a) @@ -1221,8 +1221,12 @@ set prefix [expr {[info exists :positional] && ${:positional} ? "" : "-"}] set options [list] if {[info exists :default]} { - if {[string match {*\[*\]*} ${:default}]} { - append options substdefault + if {([string first \[ ${:default}] > -1 || + [string first \$ ${:default}] > -1)} { + if {![info complete ${:default}]} { + return -code error "default value '${:default}' is an incomplete command" + } + lappend options substdefault } set :parameterSpec [list [list [:namedParameterSpec $prefix $name $options]] ${:default}] } else { @@ -1480,7 +1484,12 @@ # Only add implicit substdefault, when default is given and # substdefault is allowed via substdefault slot property. # - if {[string match {*\[*\]*} ${:default}] && ${:substdefault}} { + if {${:substdefault} && + ([string first \[ ${:default}] > -1 || + [string first \$ ${:default}] > -1)} { + if {![info complete ${:default}]} { + return -code error "default value '${:default}' is an incomplete command" + } lappend options substdefault } set :parameterSpec [list [:namedParameterSpec $prefix ${:name} $options] ${:default}]