cmdr
Check-in [8ff369076f]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix inadvertent split of trunk
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8ff369076fcf562a02ca3f56f948064fee090b9d
User & Date: andreask 2014-05-16 00:44:49
Context
2014-05-21
06:38
cmdr::actor - Fixed typo in error message check-in: a62b20fe7b user: aku tags: trunk
2014-05-16
00:46
Moved to "mistake". This requires more thought. At issue is that the "recently" made validation types "wchan" and "rwchan" generate externally visible changes as part of their creation of the internal representation. Namely, they create a file. This is problematic as in some situations the VT is called on to simply check if the input is ok, and nothing more. And while the code path in question does call on the "release" method of the VT to cleanup the internal rep the external side-effect remains. The change here went with extending "release" to allow it to undo the external effect as well, on request. This then requires determining when to do that, and when not. And that is difficult as the same APIs are used internally and given to the user. A better path might be to change the VT API. For compatibility we cannot change "validate", it has to keep doing validation + conversion. New methods would be required for each of the two parts. Then the framework can defer the creation of the int. rep until the last possible moment, i.e. when the user needs it. While the other places only requiring validation limit themselves to that, and no side-effects, in- or outside of memory. ---- Extended the std validation types to support an undo flag for their release method. Closed-Leaf check-in: 0be2930b72 user: andreask tags: mistake
00:44
Fix inadvertent split of trunk check-in: 8ff369076f user: andreask tags: trunk
00:29
cmdr::actor - New feature "common -extend", enabling extension of a block instead of overwriting it. check-in: 7ab77ead21 user: aku tags: trunk
2014-05-07
21:58
cmdr::validate (rpath) - Fixed bug in the path check. Removed bogus test for directory. This VT accepts files too. Bumped to version 1.3.1. check-in: e7ed76dd06 user: andreask tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to help_json.tcl.

     1      1   ## -*- tcl -*-
     2      2   # # ## ### ##### ######## ############# #####################
     3      3   ## CMDR - Help - JSON format. Not available by default.
     4      4   ## Require this package before creation a commander, so that the
     5      5   ## mdr::help heuristics see and automatically integrate the format.
     6      6   
     7      7   # @@ Meta Begin
     8         -# Package cmdr::help::json 1.0
            8  +# Package cmdr::help::json 1.0.1
     9      9   # Meta author   {Andreas Kupries}
    10     10   # Meta location https://core.tcl.tk/akupries/cmdr
    11     11   # Meta platform tcl
    12     12   # Meta summary     Formatting help as JSON object.
    13     13   # Meta description Formatting help as JSON object.
    14     14   # Meta subject {command line}
    15     15   # Meta require {Tcl 8.5-}
................................................................................
    81     81   namespace eval ::cmdr::help::format::JSON {}
    82     82   
    83     83   proc ::cmdr::help::format::JSON::acategory {path cmds subc} {
    84     84       set name [lindex $path end]
    85     85   
    86     86       # With struct::list map we could then also re-use alist.
    87     87       set commands {}
    88         -    foreach def [lsort -dict -unique [dict get $cmds $path]] {
    89         -	lassign $def cname _
    90         -	lappend commands [json::write string $cname]
           88  +    if {[dict exists $cmds $path]} {
           89  +	foreach def [lsort -dict -unique [dict get $cmds $path]] {
           90  +	    lassign $def cname _
           91  +	    lappend commands [json::write string $cname]
           92  +	}
    91     93       }
    92     94   
    93     95       set sections {}
    94     96       if {[dict exists $subc $path]} {
    95     97   	# Add the sub-categories, if any.
    96     98   	foreach c [lsort -dict -unique [dict get $subc $path]] {
    97     99   	    lappend sections [acategory [linsert $path end $c] $cmds $subc]
................................................................................
   197    199   proc ::cmdr::help::format::JSON::astring {string} {
   198    200       regsub -all -- {[ \n\t]+} $string { } string
   199    201       return [json::write string [string trim $string]]
   200    202   }
   201    203   
   202    204   # # ## ### ##### ######## ############# #####################
   203    205   ## Ready
   204         -package provide cmdr::help::json 1.0
          206  +package provide cmdr::help::json 1.0.1

Changes to help_tcl.tcl.

     1      1   ## -*- tcl -*-
     2      2   # # ## ### ##### ######## ############# #####################
     3      3   ## CMDR - Help - TCL format. Not available by default.
     4      4   ## Require this package before creation a commander, so that the
     5      5   ## mdr::help heuristics see and automatically integrate the format.
     6      6   
     7      7   # @@ Meta Begin
     8         -# Package cmdr::help::tcl 1.0
            8  +# Package cmdr::help::tcl 1.0.1
     9      9   # Meta author   {Andreas Kupries}
    10     10   # Meta location https://core.tcl.tk/akupries/cmdr
    11     11   # Meta platform tcl
    12     12   # Meta summary     Formatting help as TCL data structure (nested dict/list).
    13     13   # Meta description Formatting help as TCL data structure (nested dict/list).
    14     14   # Meta subject {command line}
    15     15   # Meta require {Tcl 8.5-}
................................................................................
    77     77   namespace eval ::cmdr::help::format::TCL {}
    78     78   
    79     79   proc ::cmdr::help::format::TCL::acategory {path cmds subc} {
    80     80       set name [lindex $path end]
    81     81   
    82     82       # With struct::list map we could then also re-use alist.
    83     83       set commands {}
    84         -    foreach def [lsort -dict -unique [dict get $cmds $path]] {
    85         -	lappend commands [lindex $def 0]
           84  +    if {[dict exists $cmds $path]} {
           85  +	foreach def [lsort -dict -unique [dict get $cmds $path]] {
           86  +	    lappend commands [lindex $def 0]
           87  +	}
    86     88       }
    87     89   
    88     90       set sections {}
    89     91       if {[dict exists $subc $path]} {
    90     92   	# Add the sub-categories, if any.
    91     93   	foreach c [lsort -dict -unique [dict get $subc $path]] {
    92     94   	    lappend sections [acategory [linsert $path end $c] $cmds $subc]
................................................................................
   176    178   proc ::cmdr::help::format::TCL::astring {string} {
   177    179       regsub -all -- {[ \n\t]+} $string { } string
   178    180       return [string trim $string]
   179    181   }
   180    182   
   181    183   # # ## ### ##### ######## ############# #####################
   182    184   ## Ready
   183         -package provide cmdr::help::tcl 1.0
          185  +package provide cmdr::help::tcl 1.0.1

Changes to validate.tcl.

   384    384   proc ::cmdr::validate::rpath::validate {p x} {
   385    385       debug.cmdr/validate {}
   386    386       if {[Ok $x]} { return $x }
   387    387       fail $p RPATH "an existing readable path" $x
   388    388   }
   389    389   
   390    390   proc ::cmdr::validate::rpath::Ok {path} {
   391         -    if {![file exists      $path]} {return 0}
   392         -    if {![file isdirectory $path]} {return 0}
   393         -    if {![file readable    $path]} {return 0}
          391  +    if {![file exists   $path]} {return 0}
          392  +    if {![file readable $path]} {return 0}
   394    393       return 1
   395    394   }
   396    395   
   397    396   # # ## ### ##### ######## ############# #####################
   398    397   ## Any path, existing and read/writable.
   399    398   
   400    399   namespace eval ::cmdr::validate::rwpath {
................................................................................
   536    535       if {![file readable $path]} {return 0}
   537    536       if {![file writable $path]} {return 0}
   538    537       return 1
   539    538   }
   540    539   
   541    540   # # ## ### ##### ######## ############# #####################
   542    541   ## Ready
   543         -package provide cmdr::validate 1.3
          542  +package provide cmdr::validate 1.3.1
   544    543   return