Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | cmdr::help::json, cmdr::help::tcl - Fixed handling of category with sub-categories, but no commands. Bumped to version 1.0.1. |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b5c480978951c6709197169d36793702 |
User & Date: | andreask 2014-05-05 18:52:13.578 |
Context
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 | |
2014-05-05
| ||
18:52 | cmdr::help::json, cmdr::help::tcl - Fixed handling of category with sub-categories, but no commands. Bumped to version 1.0.1. check-in: b5c4809789 user: andreask tags: trunk | |
2014-04-23
| ||
05:39 | Move the p-name helper command of validate::common into the parameter class, as a convenience method. check-in: 288c34780b user: aku tags: trunk | |
Changes
Changes to help_json.tcl.
1 2 3 4 5 6 7 | ## -*- tcl -*- # # ## ### ##### ######## ############# ##################### ## CMDR - Help - JSON format. Not available by default. ## Require this package before creation a commander, so that the ## mdr::help heuristics see and automatically integrate the format. # @@ Meta Begin | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## -*- tcl -*- # # ## ### ##### ######## ############# ##################### ## CMDR - Help - JSON format. Not available by default. ## Require this package before creation a commander, so that the ## mdr::help heuristics see and automatically integrate the format. # @@ Meta Begin # Package cmdr::help::json 1.0.1 # Meta author {Andreas Kupries} # Meta location https://core.tcl.tk/akupries/cmdr # Meta platform tcl # Meta summary Formatting help as JSON object. # Meta description Formatting help as JSON object. # Meta subject {command line} # Meta require {Tcl 8.5-} |
︙ | ︙ | |||
81 82 83 84 85 86 87 | namespace eval ::cmdr::help::format::JSON {} proc ::cmdr::help::format::JSON::acategory {path cmds subc} { set name [lindex $path end] # With struct::list map we could then also re-use alist. set commands {} | > | | | > | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | namespace eval ::cmdr::help::format::JSON {} proc ::cmdr::help::format::JSON::acategory {path cmds subc} { set name [lindex $path end] # With struct::list map we could then also re-use alist. set commands {} if {[dict exists $cmds $path]} { foreach def [lsort -dict -unique [dict get $cmds $path]] { lassign $def cname _ lappend commands [json::write string $cname] } } set sections {} if {[dict exists $subc $path]} { # Add the sub-categories, if any. foreach c [lsort -dict -unique [dict get $subc $path]] { lappend sections [acategory [linsert $path end $c] $cmds $subc] |
︙ | ︙ | |||
197 198 199 200 201 202 203 | proc ::cmdr::help::format::JSON::astring {string} { regsub -all -- {[ \n\t]+} $string { } string return [json::write string [string trim $string]] } # # ## ### ##### ######## ############# ##################### ## Ready | | | 199 200 201 202 203 204 205 206 | proc ::cmdr::help::format::JSON::astring {string} { regsub -all -- {[ \n\t]+} $string { } string return [json::write string [string trim $string]] } # # ## ### ##### ######## ############# ##################### ## Ready package provide cmdr::help::json 1.0.1 |
Changes to help_tcl.tcl.
1 2 3 4 5 6 7 | ## -*- tcl -*- # # ## ### ##### ######## ############# ##################### ## CMDR - Help - TCL format. Not available by default. ## Require this package before creation a commander, so that the ## mdr::help heuristics see and automatically integrate the format. # @@ Meta Begin | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## -*- tcl -*- # # ## ### ##### ######## ############# ##################### ## CMDR - Help - TCL format. Not available by default. ## Require this package before creation a commander, so that the ## mdr::help heuristics see and automatically integrate the format. # @@ Meta Begin # Package cmdr::help::tcl 1.0.1 # Meta author {Andreas Kupries} # Meta location https://core.tcl.tk/akupries/cmdr # Meta platform tcl # Meta summary Formatting help as TCL data structure (nested dict/list). # Meta description Formatting help as TCL data structure (nested dict/list). # Meta subject {command line} # Meta require {Tcl 8.5-} |
︙ | ︙ | |||
77 78 79 80 81 82 83 | namespace eval ::cmdr::help::format::TCL {} proc ::cmdr::help::format::TCL::acategory {path cmds subc} { set name [lindex $path end] # With struct::list map we could then also re-use alist. set commands {} | > | | > | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | namespace eval ::cmdr::help::format::TCL {} proc ::cmdr::help::format::TCL::acategory {path cmds subc} { set name [lindex $path end] # With struct::list map we could then also re-use alist. set commands {} if {[dict exists $cmds $path]} { foreach def [lsort -dict -unique [dict get $cmds $path]] { lappend commands [lindex $def 0] } } set sections {} if {[dict exists $subc $path]} { # Add the sub-categories, if any. foreach c [lsort -dict -unique [dict get $subc $path]] { lappend sections [acategory [linsert $path end $c] $cmds $subc] |
︙ | ︙ | |||
176 177 178 179 180 181 182 | proc ::cmdr::help::format::TCL::astring {string} { regsub -all -- {[ \n\t]+} $string { } string return [string trim $string] } # # ## ### ##### ######## ############# ##################### ## Ready | | | 178 179 180 181 182 183 184 185 | proc ::cmdr::help::format::TCL::astring {string} { regsub -all -- {[ \n\t]+} $string { } string return [string trim $string] } # # ## ### ##### ######## ############# ##################### ## Ready package provide cmdr::help::tcl 1.0.1 |