cmdr
Check-in [c0c62eb8c0]
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:Put section information into the json format.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c0c62eb8c05f4a904f5aaf6c2b61b5576f51bf46
User & Date: aku 2013-10-29 05:40:15
Context
2013-10-29
05:44
Extended the json help format with a map "opt2para" from options to controlling parameter (name to name). check-in: d04e732ab1 user: aku tags: trunk
05:40
Put section information into the json format. check-in: c0c62eb8c0 user: aku tags: trunk
05:35
Regenerated embedded documentation. check-in: 828eb35b6d user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to help_json.tcl.

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77

78
79
80
81
82
83
84
namespace eval ::cmdr::help::format::JSON {}

proc ::cmdr::help::format::JSON {command} {
    # Data structure: see config.tcl,  method 'help'.
    # Data structure: see private.tcl, method 'help'.

    dict with command {}
    # -> action, desc, options, arguments, parameters, states

    lappend dict description [JSON::astring    $desc]
    lappend dict action      [JSON::alist      $action]
    lappend dict arguments   [JSON::alist      $arguments]
    lappend dict options     [JSON::adict      $options]
    lappend dict states      [JSON::alist      $states]
    lappend dict parameters  [JSON::parameters $parameters]

    
    return [json::write object {*}$dict]
}

proc ::cmdr::help::format::JSON::parameters {parameters} {
    set dict {}
    foreach {name def} [::cmdr::help::DictSort $parameters] {







|







>







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
namespace eval ::cmdr::help::format::JSON {}

proc ::cmdr::help::format::JSON {command} {
    # Data structure: see config.tcl,  method 'help'.
    # Data structure: see private.tcl, method 'help'.

    dict with command {}
    # -> action, desc, options, arguments, parameters, states, sections

    lappend dict description [JSON::astring    $desc]
    lappend dict action      [JSON::alist      $action]
    lappend dict arguments   [JSON::alist      $arguments]
    lappend dict options     [JSON::adict      $options]
    lappend dict states      [JSON::alist      $states]
    lappend dict parameters  [JSON::parameters $parameters]
    lappend dict sections    [JSON::alist      $sections]
    
    return [json::write object {*}$dict]
}

proc ::cmdr::help::format::JSON::parameters {parameters} {
    set dict {}
    foreach {name def} [::cmdr::help::DictSort $parameters] {