Index: library/nx/nx.tcl =================================================================== diff -u -N -r09b4bca7c8d5c44f6be0b2c04ebfcdb7a58fd5ae -r6b832b6b58cbf75eb791de8271291a149e4b4fb3 --- library/nx/nx.tcl (.../nx.tcl) (revision 09b4bca7c8d5c44f6be0b2c04ebfcdb7a58fd5ae) +++ library/nx/nx.tcl (.../nx.tcl) (revision 6b832b6b58cbf75eb791de8271291a149e4b4fb3) @@ -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}]