cmdr
Check-in [4add0ceabc]
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:help - Switched to method "extend" over "learn" to define the command, simpler.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4add0ceabc4a54e0d22c5cc8018398c300d69615
User & Date: andreask 2014-04-15 19:30:39
Original Comment: Switched to method "extend" over "learn" to define the command, simpler.
Context
2014-04-15
19:42
Added hooks for history mgmt, plus helper package to the system. Known issue: *prefix* handling for recursion (aliases). check-in: 639bdf2ae3 user: andreask tags: trunk
19:30
help - Switched to method "extend" over "learn" to define the command, simpler. check-in: 4add0ceabc user: andreask tags: trunk
19:27
Hide docs from kettle's scanner for Tcl packages. check-in: 8a156a1311 user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to help.tcl.

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
	    alias w
	    validate integer ;# better: integer > 0, or even > 10
	    generate [lambda {p} { linenoise columns }]
	}
    }
    lappend map @formats@ [linsert [join $formats {, }] end-1 and]
    lappend map @options@ [join $options \n]
    lappend map @actor@   $actor

    $actor learn [string map $map {private help {
	section *AutoGenerated*
	description {
	    Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.
	}
	@options@
................................................................................
	    This field is fed by the options @formats@.
	} { default {} }
	input cmdname {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} { optional ; list }
    } {::cmdr::help::auto-help @actor@}}]
    return
}

proc ::cmdr::help::auto-help {actor config} {
    debug.cmdr/help {}

    set width  [$config @width]







<

|







 







|







102
103
104
105
106
107
108

109
110
111
112
113
114
115
116
117
...
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	    alias w
	    validate integer ;# better: integer > 0, or even > 10
	    generate [lambda {p} { linenoise columns }]
	}
    }
    lappend map @formats@ [linsert [join $formats {, }] end-1 and]
    lappend map @options@ [join $options \n]


    $actor extend help [string map $map {
	section *AutoGenerated*
	description {
	    Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.
	}
	@options@
................................................................................
	    This field is fed by the options @formats@.
	} { default {} }
	input cmdname {
	    The entire command line, the name of the
	    command to get help for. This can be several
	    words.
	} { optional ; list }
    }] [list ::cmdr::help::auto-help $actor]
    return
}

proc ::cmdr::help::auto-help {actor config} {
    debug.cmdr/help {}

    set width  [$config @width]