cmdr
Check-in [7e77c5a0be]
Not logged in

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

Overview
Comment:Excluded auto-added commands from categorized help.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7e77c5a0bebbb3a01ec2931f5988aa7899a7e3c3
User & Date: andreask 2014-02-17 23:29:04
Context
2014-02-19
20:20
officer - Extended class to accept the unique prefixes of the known command names for dispatch. check-in: 434ada2661 user: andreask tags: trunk
19:11
Draft code for additional vtypes: Paths, with appropriate open channels as internal rep. check-in: 209bf08a86 user: aku tags: more-vtypes
2014-02-17
23:29
Excluded auto-added commands from categorized help. check-in: 7e77c5a0be user: andreask tags: trunk
20:20
Tweak to default format selection of help, use "short" for interior nodes. check-in: ac17c7fb74 user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to help.tcl.

105
106
107
108
109
110
111

112
113
114
115
116
117
118
...
436
437
438
439
440
441
442





443
444
445
446
447
448
449
...
517
518
519
520
521
522
523
524
	}
    }
    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 {

	description {
	    Retrieve help for a command or command set.
	    Without arguments help for all commands is given.
	    The default format is --full.
	}
	@options@
	state format {
................................................................................

    array set subc {} ;# category path -> list (child category path)
    array set cmds {} ;# category path -> list (cmd)
    #                    cmd = tuple (label description)

    dict for {name def} $help {
	dict with def {} ; # -> desc, arguments, parameters, sections






	if {![llength $sections]} {
	    lappend sections Miscellaneous
	}

	if {$fmtname} {
	    append name " " [Arguments $arguments $parameters]
................................................................................

    return $categories
}


# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help 1.1







>







 







>
>
>
>
>







 







|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
...
523
524
525
526
527
528
529
530
	}
    }
    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@
	state format {
................................................................................

    array set subc {} ;# category path -> list (child category path)
    array set cmds {} ;# category path -> list (cmd)
    #                    cmd = tuple (label description)

    dict for {name def} $help {
	dict with def {} ; # -> desc, arguments, parameters, sections

	# Do not show the auto-generated commands in the categorized help.
	if {"*AutoGenerated*" in $sections} {
	    continue
	}

	if {![llength $sections]} {
	    lappend sections Miscellaneous
	}

	if {$fmtname} {
	    append name " " [Arguments $arguments $parameters]
................................................................................

    return $categories
}


# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::help 1.2

Changes to officer.tcl.

190
191
192
193
194
195
196

197
198
199
200
201
202
203
...
677
678
679
680
681
682
683
684
	}

	# Auto-create an 'exit' command when possible, i.e not in
	# conflict with a user-specified command.
	if {![my has exit]} {
	    my learn {
		private exit {

		    description {
			Exit the shell.
			No-op if not in a shell.
		    }
		} [mymethod shell-exit]
	    }
	}
................................................................................
	myreplexit myhandler

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::officer 1.1







>







 







|
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
...
678
679
680
681
682
683
684
685
	}

	# Auto-create an 'exit' command when possible, i.e not in
	# conflict with a user-specified command.
	if {![my has exit]} {
	    my learn {
		private exit {
		    section *AutoGenerated*
		    description {
			Exit the shell.
			No-op if not in a shell.
		    }
		} [mymethod shell-exit]
	    }
	}
................................................................................
	myreplexit myhandler

    # # ## ### ##### ######## #############
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::officer 1.2